Retrieve Values for Multi-Select Field Being Return by nlapiLookupField
Published on
November 30, 2023 at 7:41:04 AM PST November 30, 2023 at 7:41:04 AM PSTth, November 30, 2023 at 7:41:04 AM PST
Scenario
Using nlapiLoadRecord then nlobjRecord.getFieldTexts function to retrieve multi-select field selected values will return an array. However this is not the case when you try to retrieve values using nlapiLookupField as it will return String values.
Solution
In order to convert this to array, we can use a JavaScript function such assplit(), to split string to an array ofsubstrings.The sample code below is a resolution for this concern: