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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
nlapiCopyRecord not working on custom record
Hi,
I am trying to duplicate a record in a custom record type, but it seems to create a new record instead. First of all, I when I ran my script it asked me to supply a 'name' (as the 'Include Name field' is checked) which I did, everything went through with no error. Then I noticed that it had not duplicated the record, but instead just created a new one with all the fields empty. Can anyone please shed some light on this? Here is my code:
var salesOrderAttr = nlapiCopyRecord('customrecord_tran_item_att', 47); salesOrderAttr.setFieldValue('custrecord_quote_id',null); salesOrderAttr.setFieldValue('custrecord_sales_order_id',salesOrderId); salesOrderAttr.setFieldValue('name', 'testing'); var errorFlag = nlapiSubmitRecord(salesOrderAttr); 0