Hello Everyone, I am trying to set the value on T...
# suitescript
s
Hello Everyone, I am trying to set the value on Transfer record but getting the below error. {"type":"error.SuiteScriptError","name":"UNEXPECTED_ERROR","message":"ReferenceError: \"document\" is not defined. (NLRecordScripting.scriptInit$lib#402)","stack" Please help
e
Are you setting the value client side or server side?
s
Server side
e
Would you mind sharing your code?
s
var transferRec = record.load({ type: transType, id: transRecId }); transferRec.setValue({ fieldId: 'custbody_upy_linked_to_bai', value: true }); var tranferId = transferRec.save();
e
Based on the error message, it looks to me like you are including a library:
NLRecordScripting.scriptInit
which is referencing
document
on line 402
document
is not defined in a server-side script as there is no DOM
s
No, Im not using any library
w
Maybe you have some userevent script on transferrecords that actually is throwing the error? (unless your code is in a userevent script)