I have a scheduled script (1.0) that is failing wh...
# suitescript
k
I have a scheduled script (1.0) that is failing when the nlapiYieldScript is called. The failure is returning SS_DISALLOWED_OBJECT_REFERENCE. It’s in a loop and it successfully completes hundreds of records before hitting this error. The step before it is an nlapiSubmitField(). Could someone tell me what could be going wrong?
c
check out suiteanswer 23405
k
Thanks for responding, I had and it doesn’t really help me to figure out why it went wrong. The script is set up to catch the error but it doesn’t return what object is causing the issue @creece
c
If you log the entire object, you should get a stack trace
if its still unclear, you may have to ask support. I haven't run into that one and just found it on suiteanswers.
if its working for a lot of records before, it leads me to think its bad data in the ones that are failing though. What data is failing i have no idea though.
k
I received this message: com.netsuite.suitescript.scriptobject.ScriptNullObjectAdapter@72ba554 But of course that doesn’t really explain anything. Thanks for your help!
c
what does your log statement look like
k
var nle = nlapiCreateError(e); err = { method: ‘Update’, stacktrace: nle.stack, reasoncode: nle.name, message: nle.message, event: nle.eventType, id: nle.id, internalid: nle.recordid };
c
you should just be able to do a nlapiLogExecution('debug', ex); and it shoudl log the entire object or you can JSON.stringify(ex) if its not working.
you shouldn't have to create an error. Just log what is thrown
k
Will do so. Thanks!
b
you need to null out unsupported objects before yielding
k
So it is the nlapiSubmitField that is causing the error? I thought it would be part of nlobjRecord which is a supported object for the yield @battk
b
unlikely, its doesnt return an object
👍 1