I have a search that is finding values from a mult...
# suitescript
p
I have a search that is finding values from a multiselect field and I need to use those values to populate the same field in a different transaction. I am able to get the field values but when I go to set the field values using what was found I get an unexpected error.
Copy code
var originalLicenseType = result.getValue({ name: "custbody_licenseType"});
recCurrent.setValue({ fieldId: 'custbody_licenseType',value: originalLicenseType});
I also tried using getText and setText but that is doing nothing - no error either
Copy code
var originalLicenseType = result.getText({ name: "custbody_licenseType"});
recCurrent.setText({ fieldId: 'custbody_licenseType',text: originalLicenseType});
Any ideas on how I can accomplish what I am looking to do?
s
You need to look at what
originalLicenseType
is, its not the same format you would use to set a multiselect field via code.
It's typically an array of objects, which is not what you give to
setValue
p
thanks. was able to get it to work.