My item demand planning doesn't show any items, ca...
# ask-stanley-ai
a
My item demand planning doesn't show any items, can I import demand history csv to fix issue?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that if your item demand planning doesn't show any items, there could be several reasons for this. One of the reasons could be related to the Vendor field. Make sure that the Vendor field is correctly filled out for the items that are not appearing in the demand planning reports. If you're trying to use the Demand Planning feature with the Sales Forecast projection method and you don't have historical sales data, you might need to import your sales history from your previous ERP System. The Sales Forecast projection method looks into existing sales orders, quotes, opportunities, etc., but having historical data could be beneficial. As for importing demand history via CSV to fix the issue, it seems that creating an Item Demand Plan via script is possible, and the transaction is supported via CSV import. However, there might be a limit to the number of lines (weeks) you can add. In the provided code sample, the user was unable to add more than 52 lines. Here is the function they used:
Copy code
javascript
function createEditDemandPlan(itemObj){
    try{
        if(itemObj.demandPlan.length > 0){
            record.delete({
                type: record.Type.ITEM_DEMAND_PLAN,
                id: itemObj.demandPlan
            })
        }
        let demandPlan = record.create({
            type: record.Type.ITEM_DEMAND_PLAN,
            isDynamic: true,
        });
        //... rest of the code
    }catch(e){
        log.error('Caught Error', e.message);
        log.error('Caught Error', e.stack);
    }
}
Please note that this is a simplified version of the function. You might need to adjust it according to your needs. Also, it's recommended to use the matrix-related APIs to avoid the weird underscores in your code. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835663438
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821578085
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812339962
Please provide your feedback on this answer.