i need to fill the description field with a sublis...
# suitescript
v
i need to fill the description field with a sublist field which is an array. so if there are 3 values, those values should be filled one by one in the description field, like below, value1 value2 value3. Could anyone please tell me what should i include in the script?
n
array.join() method is probably what youre looking for. in your case if you want the line returns it would look something like this
Copy code
const myArray = ['value1', 'value2', 'value3']

rec.setValue({fieldId: 'description', value: myArray.join('\n')})
v
Thank you its working find