Check MultiSelect/Checkbox is not empty returns error

Check MultiSelect/Checkbox is not empty returns error

Hi,

When I try to use both of the following in a function I get an error:
  1. if(record.Multiselect_Field_Name.isempty()
  2. {
  3. }

Error returned is:

  Error details:

Error in executing On Edit - On Success script.
Error in executing thisapp.Material_Issues_TS.Bank_guarantee_limitations function. Line:(184)
Value is empty and 'isempty' function cannot be applied Line:(31)

  1. if(record.Multiselect_Field_Name.size() > 0
  2. {
  3. }
Error details:

Error in executing On Edit - On Success script.
Error in executing thisapp.Material_Issues_TS.Bank_guarantee_limitations function. Line:(184)
Value is empty and 'size' function cannot be applied Line:(31)
Checking for a null value does not work either, I do not get an error but the code in the if block will not run.

To actually get it to work I have had to convert it to a string and check if it's empty like:
  1. if(record.Multiselect_Field_Name.toString() = ""
  2. {
  3. }
Please fix this.

Damien Cregan
Hire an Expert