In this screenshot, i need to take the charges arr...
# suitescript
v
In this screenshot, i need to take the charges array length 5. how to take this?
n
Do you actually have that as an Object to reference or are you showing the JSON version of a record?
Is it a multi-select or list field?
if it's an object and you're showing it in full it looks like: lineFields{"item"}[0]["charges"].length. If charges is a list, you'd want to use getField and getSelectOptions If it's a multi-select getValues()
v
its a hypertext, i want to loop over those 5 charges
n
"hypertext" ?
Where / how are you accessing this, can you give some context?
v
when i click the 5 i will open the charges of that invoice with 5 entries.
n
Ok so that's what happens when you click on it but how are you trying to access it that you're struggling to do?
v
i need to get the length 5 of that array which is already into an other array item.
n
yes...
It looks like you're trying to access a sublist field on the "item" sublist but I'm not familiar with that particular field "charges", could be dynamically added and not stored on the record, you may actually have to perform a search but you're not giving me much to work with and I have no example where I can see a charge in any of the accounts I've just poked my nose in.
v
ok
actually its a sublist field which value is again an array. so i need just that array length.
n
try getValues
s
word of warning - the 'field explorer' is NOT the NS official data model for records.
💯 1