Discussions
Creating a new Manufacturing Routing
Hi,
Need some help with a script I am doing. I am trying to do a setup some defaults when a new Manufacturing Routing is created. Having trouble setting the 'manufacturingcosttemplate' and the 'manufacturingworkcenter' fields on the 'routingstep' sublist. Whether I use the internal Id or the text, it just doesn't work. Sample code:
nlapiSelectNewLineItem('routingstep');
nlapiSetCurrentLineItemValue('routingstep', 'operationsequence', q + 1);
nlapiSetCurrentLineItemValue('routingstep', 'manufacturingcosttemplate', cost_template_id);
nlapiSetCurrentLineItemValue('routingstep', 'manufacturingworkcenter', work_centre_id);
nlapiSetCurrentLineItemValue('routingstep', 'operationname', work_centre_name);
nlapiSetCurrentLineItemValue('routingstep', 'runrate', 1);
nlapiSetCurrentLineItemValue('routingstep', 'setuptime', 1);
window.alert('line done');
nlapiCommitLineItem('routingstep');
Line 3 and 4 never work and hence the line does not get committed. I even tried hardcoding the internal ID and the text but none of them work.