Discussions
Sourcing Doc. No in Create Record Script
I have written a script to create a new custom record when a sales order is saved. I have successfully gotten the script to pull the entity id, shipto address, and other custom fields, but I cannot get it to load the Doc. No or "tranid" from the Sales Order.
var currentRecord = nlapiGetNewRecord();
var CustomerName = currentRecord.getFieldValue('entity');
var Order = currentRecord.getFieldValue('tranid');
var recordCreated = nlapiCreateRecord('customrecord6');
recordCreated.setFieldValue('custrecord10', CustomerName);
recordCreated.setFieldValue('custrecord4', Order);
For custrecord4, which is the field for Order # on my custom record, I have tried setting the type to List/Record and Free-Form Text. Niether of these is working.