Item Demand Plan

The item demand plan record is available for inventory items when the Demand Planning feature is enabled, and for assembly/BOM items when both the Demand Planning and Work Orders features are enabled. Item demand plans can be added for items where the supplyReplenishMethod field is set to Time Phased.

An item demand plan transaction stores the quantity expected to be needed, during specified time periods, for an item. NetSuite supports three types of demand plans: monthly, weekly, and daily.

For more information about using item demand plans, see Demand Planning.

Each demand plan includes values for body fields used to uniquely identify the record, such as item, startDate, endDate, location (when Multi-Location Inventory is enabled), and subsidiary (for NetSuite OneWorld). A demandPlanCalendarType body field indicates the time period used in the demand plan: monthly, weekly, or daily. The following identifier fields are supported: externalId, internalId, and demandPlanId.

Demand plan sublist data is represented by a periodDemandPlan matrix list. This data varies according to the demand plan type.

The item demand plan record is defined in the transactions demandPlanning XSD.

Supported Operations

add | addList | delete | deleteList | get | | getDeleted | getList | getSavedSearch | getSelectValue | search | update | updateList | upsert | upsertList

Note:

You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s item demand plan reference page.

Note:

For information on using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

Understanding Start Date and End Date Fields

Each item demand plan record includes body-level startDate and endDate fields and additional startDate and endDate fields for each sublist line.

Body-Level Dates

Body-level startDate and endDate fields are required. The body-level startDate field defaults to January 1 of the current year, and the body-level endDate field defaults to December 31 of the current year, if values are not provided.

Important:

Edits are only supported for records where the body-level startDate and endDate fields are within three years of the current year.

Line-Level Dates

Line-level startDate and endDate fields must fall within body-level startDate and endDate fields.

Line-level endDate fields are read-only.

For monthly demand plans, every line-level startDate value must correspond to the first day of a month. For weekly and daily demand plans, every line-level startDate value must correspond to the first day of a week, based on the company preference for First Day of Week set at Setup > Company > General Preferences. (The default is Sunday.)

Demand Planning Sublist

Updates to the periodDemandPlan sublist respect the replaceAll attribute. The handling of replaceAll for matrix sublists like periodDemandPlan is more involved than its handling for most keyed sublists. For details, see Matrix Sublists and replaceAll.

The startDate field is required and is the key for this sublist.

A get operation only returns lines that have quantity values.

Searching Demand Plans

An advanced search (getSavedSearch) of demand plans returns lines. A basic search returns the whole record.

The only supported filters are the body-level startDate and endDate fields. These filters are required.

Sample Code

The following code illustrates how to create monthly, weekly, and daily item demand plans.

Monthly Item Demand Plan Java

          public void testAddDemandPlanningMonthly() throws Exception
                {
                                c.setCredentials(CRED_DEV_DB93);
                                c.useRequestLevelCredentials();
                                ItemDemandPlan dp = new ItemDemandPlan();
 
                                // subsidiary
                                RecordRef subsidiary = new RecordRef();
                                subsidiary.setInternalId("1");
                                subsidiary.setType(RecordType.subsidiary);
                                dp.setSubsidiary(subsidiary);
                                dp.setExternalId("1234567");
                                // location
                                RecordRef location = new RecordRef();
                                location.setInternalId("7"); // Location US 2
                                location.setType(RecordType.location);
                                dp.setLocation(location);
 
                                // inventory item
                                RecordRef inventoryItem = new RecordRef();
                                inventoryItem.setInternalId("202"); // Inventory Item with "Time Phased" Replenishment Method
                                inventoryItem.setType(RecordType.inventoryItem);
                                dp.setItem(inventoryItem);
 
                                dp.setStartDate(new GregorianCalendar(2011,0,1));
                                dp.setDemandPlanCalendarType(DemandPlanCalendarType._monthly);
 
                                // demand plan matrix
                                DemandPlanMatrix matrix = new DemandPlanMatrix();
                                DemandPlan[] demandPlans = new DemandPlan[2];
                                demandPlans[0] = new DemandPlan();
                                demandPlans[1] = new DemandPlan();
 
                                // 1/1/2011
                                demandPlans[0].setStartDate(new GregorianCalendar(2011,0,1));
                                PeriodDemandPlanList planList = new PeriodDemandPlanList();
                                PeriodDemandPlan[] plans = new PeriodDemandPlan[1];
                                plans[0] = new PeriodDemandPlan();
 
                                plans[0].setQuantity(5.0);
                                planList.setPeriodDemandPlan(plans);
                                demandPlans[0].setPeriodDemandPlanList(planList);
 
                                // 2/1/2011
                                demandPlans[1].setStartDate(new GregorianCalendar(2011,1,1));
                                PeriodDemandPlanList planList2 = new PeriodDemandPlanList();
                                PeriodDemandPlan[] plans2 = new PeriodDemandPlan[1];
                                plans2[0] = new PeriodDemandPlan();
 
                                plans2[0].setQuantity(7.0);
                                planList2.setPeriodDemandPlan(plans2);
                                demandPlans[1].setPeriodDemandPlanList(planList2);
                                matrix.setDemandPlan(demandPlans);
                                dp.setDemandPlanMatrix(matrix);
                                c.addRecord(dp);
                } 

        

Monthly Item Demand Plan SOAP Request

           <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
            <record xsi:type="ns6:ItemDemandPlan" xmlns:ns6="urn:demandplanning_2017_1.transactions.webservices.netsuite.com">    
               <ns6:subsidiary internalId="1" type="subsidiary" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:location internalId="7" type="location" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:item internalId="199" type="inventoryItem" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:startDate xsi:type="xsd:dateTime">2009-01-01T08:00:00.000Z</ns6:startDate>    
               <ns6:endDate xsi:type="xsd:dateTime">2011-12-31T08:00:00.000Z</ns6:endDate>    
               <ns6:demandPlanCalendarType xsi:type="ns10:DemandPlanCalendarType" xmlns:ns10="urn:types.demandplanning_2017_1.transactions.webservices.netsuite.com">_monthly</ns6:demandPlanCalendarType>    
               <ns6:demandPlanMatrix xsi:type="ns6:DemandPlanMatrix">
                  <ns6:demandPlan xsi:type="ns6:DemandPlan">
                     <ns6:startDate xsi:type="xsd:dateTime">2011-11-20T16:00:00.000Z</ns6:startDate>
                     <ns6:periodDemandPlanList xsi:type="ns6:PeriodDemandPlanList">
                        <ns6:periodDemandPlan xsi:type="ns6:PeriodDemandPlan">
                           <ns6:quantity xsi:type="xsd:double">68.0</ns6:quantity>
                        </ns6:periodDemandPlan>
                     </ns6:periodDemandPlanList>
                  </ns6:demandPlan>
               </ns6:demandPlanMatrix>   
            </record>  
         </add> 

        

Weekly Item Demand Plan Java

          public void testAddDemandPlanningWeekly() throws Exception
                {
                                c.setCredentials(CRED_DEV_DB93);
                                c.useRequestLevelCredentials();
                                ItemDemandPlan dp = new ItemDemandPlan();
 
                                // subsidiary
                                RecordRef subsidiary = new RecordRef();
                                subsidiary.setInternalId("1");
                                subsidiary.setType(RecordType.subsidiary);
                                dp.setSubsidiary(subsidiary);
                                dp.setExternalId("2345678");
                                // location
                                RecordRef location = new RecordRef();
                                location.setInternalId("7"); // Location US 2
                                location.setType(RecordType.location);
                                dp.setLocation(location);
 
                                // inventory item
                                RecordRef inventoryItem = new RecordRef();
                                inventoryItem.setInternalId("202"); // Inventory Item with "Time Phased" Replenishment Method
                                inventoryItem.setType(RecordType.inventoryItem);
                                dp.setItem(inventoryItem);
 
                                dp.setStartDate(new GregorianCalendar(2011,0,1));
                                dp.setDemandPlanCalendarType(DemandPlanCalendarType._weekly);
 
                                // demand plan matrix
                                DemandPlanMatrix matrix = new DemandPlanMatrix();
                                DemandPlan[] demandPlans = new DemandPlan[2];
                                demandPlans[0] = new DemandPlan();
                                demandPlans[1] = new DemandPlan();
 
                                // 1/2/2011
                                demandPlans[0].setStartDate(new GregorianCalendar(2011,0,2));
                                PeriodDemandPlanList planList = new PeriodDemandPlanList();
                                PeriodDemandPlan[] plans = new PeriodDemandPlan[1];
                                plans[0] = new PeriodDemandPlan();
 
                                plans[0].setQuantity(5.0);
                                planList.setPeriodDemandPlan(plans);
                                demandPlans[0].setPeriodDemandPlanList(planList);
 
                                // 1/9/2011
                                demandPlans[1].setStartDate(new GregorianCalendar(2011,0,9));
                                PeriodDemandPlanList planList2 = new PeriodDemandPlanList();
                                PeriodDemandPlan[] plans2 = new PeriodDemandPlan[1];
                                plans2[0] = new PeriodDemandPlan();
 
                                plans2[0].setQuantity(7.0);
                                planList2.setPeriodDemandPlan(plans2);
                                demandPlans[1].setPeriodDemandPlanList(planList2);
                                matrix.setDemandPlan(demandPlans);
                                dp.setDemandPlanMatrix(matrix);
                                c.addRecord(dp);
                } 

        

Weekly Item Demand Plan SOAP Request

           <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">                                                                                                                                                               
            <record xsi:type="ns6:ItemDemandPlan" xmlns:ns6="urn:demandplanning_2017_1.transactions.webservices.netsuite.com">                                                                                                                                                                                                       
               <ns6:subsidiary internalId="1" type="subsidiary" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>                                                                                                                                                                                                       
               <ns6:location internalId="7" type="location" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>                                                                                                                                                                                                       
               <ns6:item internalId="199" type="inventoryItem" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>                                                                                                                                                                                                       
               <ns6:startDate xsi:type="xsd:dateTime">2011-11-26T02:27:40.242Z</ns6:startDate>                                                                                                                                                                                    
               <ns6:endDate xsi:type="xsd:dateTime">2011-12-24T02:27:40.242Z</ns6:endDate>                                                                                                                                                                                     
               <ns6:demandPlanCalendarType xsi:type="ns10:DemandPlanCalendarType" xmlns:ns10="urn:types.demandplanning_2017_1.transactions.webservices.netsuite.com">_weekly</ns6:demandPlanCalendarType>                                                                                                                                                                                                       
               <ns6:demandPlanMatrix xsi:type="ns6:DemandPlanMatrix">                                                                                                                                                                                                                                          
                  <ns6:demandPlan xsi:type="ns6:DemandPlan">                                                                                                                                                                                                                                                                                 
                     <ns6:startDate xsi:type="xsd:dateTime">2011-11-20T16:00:00.000Z</ns6:startDate>                                                                                                                                                                                                                                                                                 
                     <ns6:periodDemandPlanList xsi:type="ns6:PeriodDemandPlanList">                                                                                                                                                                                                                                                                                                                        
                        <ns6:periodDemandPlan xsi:type="ns6:PeriodDemandPlan"> 

        

Daily Item Demand Plan Java

           public void testAddDemandPlanningDaily() throws Exception
                {
                                c.setCredentials(CRED_DEV_DB93);
                                c.useRequestLevelCredentials();
                                ItemDemandPlan dp = new ItemDemandPlan();
 
                                // subsidiary
                                RecordRef subsidiary = new RecordRef();
                                subsidiary.setInternalId("1");
                                subsidiary.setType(RecordType.subsidiary);
                                dp.setSubsidiary(subsidiary);
 
                                // location
                                RecordRef location = new RecordRef();
                                location.setInternalId("7"); // Location US 2
                                location.setType(RecordType.location);
                                dp.setLocation(location);
 
                                // inventory item
                                RecordRef inventoryItem = new RecordRef();
                                inventoryItem.setInternalId("199"); // Inventory Item with "Time Phased" Replenishment Method
                                inventoryItem.setType(RecordType.inventoryItem);
                                dp.setItem(inventoryItem);
 
                                dp.setStartDate(new GregorianCalendar(2009,0,1));
                                dp.setEndDate(new GregorianCalendar(2011,11,31));
                                dp.setDemandPlanCalendarType(DemandPlanCalendarType._daily);
 
                                // demand plan matrix
                                DemandPlanMatrix matrix = new DemandPlanMatrix();
                                DemandPlan[] demandPlans = new DemandPlan[1];
                                demandPlans[0] = new DemandPlan();
 
                                demandPlans[0].setStartDate(new GregorianCalendar(2011,0,2));
 
                                PeriodDemandPlanList planList = new PeriodDemandPlanList();
 
                                PeriodDemandPlan[] plans = new PeriodDemandPlan[2];
                                plans[0] = new PeriodDemandPlan();
                                plans[0].setDayOfTheWeek(DayOfTheWeek._sunday);
                                plans[0].setQuantity(5.0);
 
                                plans[1] = new PeriodDemandPlan();
                                plans[1].setDayOfTheWeek(DayOfTheWeek._monday);
                                plans[1].setQuantity(6.0);
                                planList.setPeriodDemandPlan(plans);
                                demandPlans[0].setPeriodDemandPlanList(planList);
                                matrix.setDemandPlan(demandPlans);
                                dp.setDemandPlanMatrix(matrix);
                                c.addRecord(dp);
                } 

        

Daily Item Demand Plan SOAP Request

           <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
            <record xsi:type="ns6:ItemDemandPlan" xmlns:ns6="urn:demandplanning_2017_1.transactions.webservices.netsuite.com">    
               <ns6:subsidiary internalId="1" type="subsidiary" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:location internalId="7" type="location" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:item internalId="199" type="inventoryItem" xsi:type="ns9:RecordRef" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com"/>    
               <ns6:startDate xsi:type="xsd:dateTime">2009-01-01T08:00:00.000Z</ns6:startDate>    
               <ns6:endDate xsi:type="xsd:dateTime">2011-12-31T08:00:00.000Z</ns6:endDate>    
               <ns6:demandPlanCalendarType xsi:type="ns10:DemandPlanCalendarType" xmlns:ns10="urn:types.demandplanning_2017_1.transactions.webservices.netsuite.com">_daily</ns6:demandPlanCalendarType>    
               <ns6:demandPlanMatrix xsi:type="ns6:DemandPlanMatrix">     
                  <ns6:demandPlan xsi:type="ns6:DemandPlan">      
                     <ns6:startDate xsi:type="xsd:dateTime">2011-01-02T08:00:00.000Z</ns6:startDate>      
                     <ns6:periodDemandPlanList xsi:type="ns6:PeriodDemandPlanList">       
                        <ns6:periodDemandPlan xsi:type="ns6:PeriodDemandPlan">        
                           <ns6:quantity xsi:type="xsd:double">5.0</ns6:quantity>        
                           <ns6:dayOfTheWeek xsi:type="ns11:DayOfTheWeek" xmlns:ns11="urn:types.demandplanning_2017_1.transactions.webservices.netsuite.com">_sunday</ns6:dayOfTheWeek>       
                        </ns6:periodDemandPlan>       
                        <ns6:periodDemandPlan xsi:type="ns6:PeriodDemandPlan">        
                           <ns6:quantity xsi:type="xsd:double">6.0</ns6:quantity>        
                           <ns6:dayOfTheWeek xsi:type="ns12:DayOfTheWeek" xmlns:ns12="urn:types.demandplanning_2017_1.transactions.webservices.netsuite.com">_monday</ns6:dayOfTheWeek>       
                        </ns6:periodDemandPlan>      
                     </ns6:periodDemandPlanList>     
                  </ns6:demandPlan>    
               </ns6:demandPlanMatrix>   
            </record>  
         </add>          
                                                                                                                      
                           <ns6:quantity xsi:type="xsd:double">68.0</ns6:quantity>                                                                                                                                                                                                                                                                                                                        
                        </ns6:periodDemandPlan>                                                                                                                                                                                                                                                                                 
                     </ns6:periodDemandPlanList>                                                                                                                                                                                                                                          
                  </ns6:demandPlan>                                                                                                                                                                                                   
               </ns6:demandPlanMatrix>                                                                                                                                                               
            </record>                                                                                                                       
         </add> 

        

Related Topics

General Notices