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.
Having trouble creating new Journal Entry (nlapiSubmitRecord)
I'm trying to create a script that takes a certain journal entry, copies everything, and saves it. That's not the end-goal of my script, but for now I'm just trying to accomplish that. My very simple test code looks like this:
... var newRecord = nlapiCopyRecord('journalentry',journalID); alert('two'); newRecord.setFieldValue('tranid', '66601'); id = nlapiSubmitRecord(newRecord,true,true); alert('three'); ... My script fails on nlapiSubmitRecord with an error of "INVALID_KEY_OR_REF"
I'm basically using nlapiCopyRecord to copy an existing journal. I wasn't sure if I HAD to change the tranid, so I tried both changing it and not changing it, but it makes no differance. 'journalID' is a valid internalid, that wouldn't be the problem.
0