I am new to NetSuite scripting and learning as I go. I needed values from a text field to set the values in a Multi Select field for Custom Record. This is running in SuiteScript 1.0. (According to people I spoke to, NetSuite does not have a native function to paste mass custom record names in a Multi Select field so the suggestion was to have a text field and an AfterSubmit event.)
My script works in a beforeSubmit event but now trying to work out multiple values rather than singular. See test script below:
function beforeSubmit(type) {
var existId = checkStr(nlapiGetFieldValue('custevent_ids'));
if (checkStr(existId) == '') {
var testIds = nlapiGetFieldValue('custevent_add_ids');
nlapiSetFieldText('custevent_ids', testIds);
}
}
I tried different variation of arrays to set the field with multiple custom record names but I just get blank, but singular it sets the custom record.
Thanks for helping a newbie out