The script shown below can serve as an alternate solution if you want to use a multiselect field as a client field to change a display type of a field. The Client script seen mimics a Set Field Display Type action on 'After Field Edit' trigger where it disables a custom field (custrecord01) when 'Selection1' is not selected on a custom multiselect field.
1. Upload and save the script as a Client SuiteScript to your NetSuite Account.
function FieldChanged(type,name)
{
var context = nlapiGetContext();
var userEmail = context.getEmail();
//customselect01 is the multiselectfield & Selection1 is one of the values
if ((name == 'custmultiselect01') && (nlapiGetFieldText('custmultiselect01') == "Selection1"))
{
// custrecord01 which is a custom record is not diabled when Selection1 is selected on the multiselect field
nlapiDisableField('custrecord01', false);
}
else
{
// custrecord01 which is a custom record is diabled when Selection1 is selected on the multiselect field
nlapiDisableField('custrecord01', true);
}
}
2. Deploy the Script to the correct record & Save
No comments:
Post a Comment