Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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."