Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
nlapiTransformRecord: Opportunity to SO - Unexpected Error?
I'm calling nlapiTransformRecord to make a SO out of an Opportunity -
Snippet:
var record = nlapiTransformRecord('opportunity', nlapiGetFieldValue('custrecord_parent_opportunity'), 'salesorder'); record.setFieldValue('trandate',nlapiDateToString(new Date())); string = 'entity: '+record.getFieldValue('entity'); string = string +' createdfrom: '+ record.getFieldValue('createdfrom'); string = string +' orderstatus: '+ record.getFieldValue('orderstatus'); string = string +' opportunity: '+ record.getFieldValue('opportunity'); string = string +' terms: '+ record.getFieldValue('terms'); string = string +' exchangerate: '+ record.getFieldValue('exchangerate'); string = string +' item: '+ record.getLineItemValue('item','item',1); string = string +' custbody_is_agent_mac: '+ record.getFieldValue('custbody_is_agent_mac'); string = string +' subtotal: '+ record.getFieldValue('subtotal'); string = string +' total: '+ record.getFieldValue('total'); alert(string); nlapiSubmitRecord(record); 0