Does anyone know what's the sublist id of the Item...
# suitescript
n
Does anyone know what's the sublist id of the Item Location Configuration (location) on item records? I tried locations, but it returns 0 in the log when there is 3
Copy code
const lineCount = rec.getLineCount('locations');
log.debug('location count', lineCount)
c
When are you executing this code? If you're running it on currentRecord in client script when a record is in View mode, it won't work.
n
Hi @Clay Roper, I am running it in user event script after item record submit
👍 1
c
Does the executing user have appropriate permissions?
n
Yes, I was executing it as admin
👍 1
c
I'm not sure - I'm able to see the expected number of lines on the
locations
sublist in a quick test of client script in devTools. Is the execution context EDIT or XEDIT?
n
context is edit. Does your account have the advance location configuration turned on?
c
@Nicole we do not have Advanced Item Location Configuration enabled. Have you checked the return of Record.getSublists() to make sure that's the right sublistId?
n
tried that, it has locations as one of the sublists.🤔
c
Is there another sublist that's a candidate for this info?
n
Not really, here's what it returned:["activities","price1","price2","price3","price4","inventorynumbers","locationstab","vendorstab","binnumber","inventorystatussrch","matrix","transactions","mediaitem","usernotes","systemnotes","translation","activeworkflows","workflowhistory","relitems","locations","itemvendor"]
c
Are you seeing this behavior on an item that has data set for it for a location already?
n
Yes
c
I wonder if the advanced item location configuration data isn't available as a sublist and needs to be joined in another way. It does appear to be a separate record entirely. Have you looked at the XML representation of the page or used the Netsuite Field Explorer extension to research the record as represented in the UI?