I want to set the value for the multi-select with existing values in that field. (i.e) If the Filed has the values "A , B" means I wants add the New Value "c" with Existing Values So, Result would be "A,B,C" .
I used "N/Record' Modules SubmitFields API to set the value for the Multi-select Field like this
CODE : SuiteScript 2.0 version :
Initial Code:
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
}
});
It is showing the error like this : "you have entered an Invalid Type Argument :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 is also showing the error: " Invalid custbody_multiselectfield'reference key 31567,31568 "
But if I add an Value as an String instead of String Array it is setting only single value (i.e) overriding the previous values. Ex: Multi-select has only the "C" value instead of "A,B,C" Values.
Can anyone help regarding this question.