Hey guys I'm having a little trouble logging the f...
# suitescript
a
Hey guys I'm having a little trouble logging the fields out of all sublists in a custom record. I'm using record.getSublists() and from that array I'm using a for loop to move through and try record.getSublistFields({sublistId:lists[i]}) but I'm getting an UNEXPECTED_ERROR with no direction of what is going on. Has anyone seen this or notice something I'm doing wrong?
I'm using this in a user event script on beforeLoad()
e
You'll want to share your code
What do your logs look like?
a
The logs are spitting out the names of the lists and then when it hits the getSublistFields I get the unexpected error
k
could you share your Log of Array getSublist ?
a
["recmachcustrecord_eq_items_parent_serial_number","recmachcustrecord_eqd_parent_serial_number","recmachcustrecord_eqdoc_model","usernotes","systemnotes","activeworkflows","workflowhistory"]
k
try by removing toString
are you able to get this worked
log.debug({title:"List",details:list});
a
Yes I'm able to get that to work
b
@adailey Were you able to get this to work? I'm having a similar issue.
a
@Blake Enloe Yes, I figured out my issue. For me I was trying to get this to output while 'viewing' a record. And it worked when I went into 'Edit' mode. I don't know why but the script works for us right now.