Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Can't Transform Sales Order to Cash Sales
Hi Friends,
I have a problem when i am transforming the SO to a Cash Sales. I am using following code to do that in my Scheduled Script.
var salesOrderrecord = nlapiLoadRecord('salesorder',id);
var fulfillRecord = nlapiTransformRecord('salesorder', id, 'itemfulfillment');
nlapiSubmitRecord( fulfillRecord );
var billType = searchresults.getValue('terms') != null ? 'invoice' : 'cashsale';
var billRecord = nlapiTransformRecord('salesorder', id, billType);
nlapiSubmitRecord( billRecord );
nlapiLogExecution("DEBUG", "Sales order transformed to cashsale","SalesOrderID = "+id);
I got the above style from one of the samples posted on the help site.
Following is the error that i get in the log
[I]"Code: INVALID_INITIALIZE_REF Details: You have an invalid sales order XXXX or the order is already closed."