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.What am I doing wrong? I'm copying an existing Journal - what could possibly be invalid?