Hi guys, I have created a script to generate sales order. The issue currently I am facing is when I insert multiple sales orders in a script in some of the sales order Order# (tanid) i.e. SO Number is not generated, is there any attribute or parameter needs to be passed when we save the sales order.
Please find the code which I am using to save the sales orders.
var rec = nRecord.create({
type: nRecord.Type.SALES_ORDER,
isDynamic: false,
defaultValues: {
entity: cart.dealer.internalid,
customform: 'FormId',
automaticallyapplypromotions: false
}
});
rec.setValue({
fieldId: 'custbody_internalid_of_a_field ',
value: 'value_of_the_field'
});
rec.save();