I'm getting an error when I try to save a custom r...
# suitescript
b
I'm getting an error when I try to save a custom record, anyone get this before: "TypeError: Cannot read property \"length\" from null I've been able to save using the same field values in the UI.
s
sounds like you are either directly or indirectly referring to a
.length
property on a object that is not set (it is null)
p
Not enough info. What sort of script etc? How did you get the string you’re trying to calculate the length of?
b
I'm not trying to get the length of any string or object, this is happening when I'm doing a .save() of a custom record
b
id guess an internal error
b
Here is the full error, if anyone has run into this before and been able to get around it, help would be appreciated. I can save the record if it is not in dynamic mode but then some values don't get sourced. _{"type":"error.SuiteScriptError","name":"UNEXPECTED_ERROR","message":"TypeError: Cannot read property \"length\" from null (INVOCATION_WRAPPER#134)","stack":["<anonymous>(N/record/recordService.js)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.user:151)","each(N/common/pattern/iterator.js)","execute(cdp_ss_create_asn.js$2558644$debugger.user:107)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:27)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:19)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:35)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:1)"],"cause":{"type":"internal error","code":"UNEXPECTED_ERROR","details":"TypeError: Cannot read property \"length\" from null (INVOCATION_WRAPPER#134)","userEvent":null,"stackTrace":["<anonymous>(N/record/recordService.js)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.user:151)","each(N/common/pattern/iterator.js)","execute(cdp_ss_create_asn.js$2558644$debugger.user:107)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:27)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:19)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:35)","<anonymous>(cdp_ss_create_asn.js$2558644$debugger.wrap:1)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}_
p
Are there any default values that are formulas on custom record fields?
b
you can try the general debugging technique of removing lines of code until you find the statement(s) causing the error