Supply Plan Definition

Supply Plan Definition enables planners to establish the criteria to be used for supply planning. The plan definition provides the information that drives the supply planning process, such as planning horizon and planning scope. For example: you can run supply planning at multiple facilities at one time. A supply plan definition provides a permanent holding place for your planning criteria and planning results.

For help working with the supply change order record in the UI, see Creating a Supply Planning Definition and Schedule.

The internal ID for this record is supplyplandefinition.

See the SuiteScript Records Browser for all internal IDs associated with this record.

See Supply Plan Definition Record Action for the actions associated with this record. For more information about actions and macros, see Overview of Record Action and Macro APIs.

For information about scripting with this record in SuiteScript, see the following:

Supported Script Types

The supply plan definition record is scriptable in server and client SuiteScript.

Supported Functions

The supply plan definition record can only be created, read, updated, deleted, searched, and copied. It cannot be transformed.

Supported Sublist

Scope sublist record ID – SCOPE_FS_TAB

Usage Notes

To work with the supply plan definition record, you must enable material requirements planning. To do this, go to Setup > Company > Enable Features. Check the Material Requirements Planning box under Items & Inventory.

Code Samples

SuiteScript 2.x

The following sample shows how to create a supply change order record using SuiteScript 2.x:

          require(['N/record'], function(record) {
   var planDefinition = record.create({type :'supplyplandefinition', isDynamic : true});
    planDefinition.setValue({fieldId:'name',         value : 'Plan Definition Name'});
    planDefinition.setValue({fieldId:'horizonindays',value : HORIZON_IN_DAYS});
    planDefinition.setValue({fieldId:'rulegroup',    value : PLANNING_RULE_GROUP_ID});
    planDefinition.setValue({fieldId:'itemgroup',    value : PLANNING_ITEM_GROUP_ID});

    planDefinition.selectNewLine({sublistId: 'scope'});
    planDefinition.setCurrentSublistValue({sublistId: 'scope', fieldId : 'location',         value : LOCATION_ID ,   ignoreFieldChange : false});
    planDefinition.setCurrentSublistValue({sublistId: 'scope', fieldId : 'demandsourcetype', value : 'SALESORDER' ,  ignoreFieldChange : false});
    planDefinition.commitLine({sublistId: 'scope'});

    planDefinition.selectNewLine({sublistId: 'scope'});
    planDefinition.setCurrentSublistValue({sublistId: 'scope', fieldId : 'location',         value : LOCATION_ID ,  ignoreFieldChange : false});
    planDefinition.setCurrentSublistValue({sublistId: 'scope', fieldId : 'demandsourcetype', value : 'DEMANDPLAN' , ignoreFieldChange : false});
    planDefinition.commitLine({sublistId: 'scope'});

    planDefinition.save();
}); 

        

Related Topics

General Notices