Hi all! Has anyone been able to get the line value...
# general
i
Hi all! Has anyone been able to get the line values from the 'cost component' sublist on the inventory cost revaluations using Suitescript? I'm not finding a way, it always returns only one result.
c
The cost component sublist is tricky with SuiteScript. You'll need to use
getLineCount()
and loop through with
getSublistValue()
to get all the component lines. Try something like: var lineCount = record.getLineCount({sublistId: 'component'}); for (var i = 0; i < lineCount; i++) { var componentValue = record.getSublistValue({ sublistId: 'component', fieldId: 'componentcost', line: i }); } Make sure you're using the right sublist ID; might be 'costcomponent' instead of 'component' depending on the record type.
❤️ 1
i
thank you!!