I want to set a value for multi-select with existing values ββin this field. (ie) If Filed has values ββ"A, B", then I want to add a new value "c" with existing values. Thus, the result will be "A, B, C".
I used the "N / Record" SubmitFields API modules to set the value for a Multi-select field, such as
CODE: SuiteScript 2.0 Version:
Source:
var strArrayValue = new Array(); strArrayValue [0] = "A"; strArrayValue [1] = "B"; strArrayValue [2] = "C"; record.submitFields({ type:'purchaseorder', id:56, values:{ custbody_multiselectfield: strArrayValue }, options: { enableSourcing: false, ignoreMandatoryFields : true } });
The error is displayed here: "you entered an invalid argument of type: arg 4"
Updated code:
var strArrayValue = new Array(); strArrayValue [0] = "A"; strArrayValue [1] = "B"; strArrayValue [2] = "C"; var PORec = record.load({ // Loading Purchase Order Recod type:"purchaseorder", id:56, isDynamic: true )}; PORec.setValue('custbody_multiselectfield',strArrayValue ); // Setting Value (Array List) for Multi-Select Fields PORec.save(); // Saving Loaded Record
It also shows an error: "Invalid custody_multiselectfield 31567,31568 link key"
But if I add the value as a string instead of a String Array, it will set only one value (ie), overriding the previous values. Example: Multi-select has only the value "C" instead of the values ββ"A, B, C".
Can anyone help in resolving this issue.
javascript arrays multi-select netsuite suitescript
Deepan murugan
source share