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
Transforming a Return Authorization -> Item Receipt
Perhaps I am going about this the wrong way - but what I would like to do is automatically generate the Item Receipt record when a particular user saves a new Return Authorization as they would only do this when customer/item is present so it is un-needed clicking to go through the process of manually clicking "Receive", ticking the boxes for the items, and then Save.
The code fired on a Return Authorization submit is:
var returnauthId = nlapiGetRecordId();
var recordType = nlapiGetRecordType();
if ((type == 'create') && (recordType == 'returnauthorization')) {
toRecord = 'itemreceipt';
itemreceipt = nlapiTransformRecord(recordType, returnauthId, toRecord);
itemreceipt.setFieldValue('landedcostmethod', 'WEIGHT');
itemreceipt.setFieldValue('landedcostsource1', 'MANUAL');