Planning Rule Group
Planning rule groups enable planners to create rules that govern the supply planning process to define how items and item categories are replenished. In NetSuite 2020.2, you can only apply these rules to transfer orders. For example, you can define where to source supply for an item when it is required at a specified location.
For help working with the planned order record in the UI, see Planning Rule Group.
The internal ID for this record is planningrulegroup
.
See the SuiteScript Records Browser for all internal IDs associated with this record.
For information about scripting with this record in SuiteScript, see the following:
Supported Script Types
The planning rule group record is scriptable in server and client SuiteScript.
Supported Functions
The planning rule group record can only be created, read, updated, deleted, searched, and copied. It cannot be transformed.
Supported Sublist
Rule sublist record ID – RULE_FS_TAB
Usage Notes
To work with the planning rule group 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 planning rule group record using SuiteScript 2.x:
require(['N/record'], function(record) {
var planningRuleGroup = record.create({type :'planningrulegroup', isDynamic : true});
planningRuleGroup.setValue({fieldId:'name', value : 'Planning Rule Group Name'});
planningRuleGroup.selectNewLine({sublistId : 'planningrules'});
planningRuleGroup.setCurrentSublistValue({sublistId : 'planningrules', fieldId : 'itemtype', value : 'ITEM' , ignoreFieldChange : false});
planningRuleGroup.setCurrentSublistValue({sublistId : 'planningrules', fieldId : 'itemorcategory', value : ITEM_ID , ignoreFieldChange : false});
planningRuleGroup.setCurrentSublistValue({sublistId : 'planningrules', fieldId : 'location', value : LOCATION_ID , ignoreFieldChange : false});
planningRuleGroup.setCurrentSublistValue({sublistId : 'planningrules', fieldId : 'sourcelocation', value : SOURCE_LOCATION_ID , ignoreFieldChange : false});
planningRuleGroup.setCurrentSublistValue({sublistId : 'planningrules', fieldId : 'leadtime', value : LEAD_TIME , ignoreFieldChange : false});
planningRuleGroup.commitLine({sublistId :'planningrules'});
planningRuleGroup.save();
});