Checkbox select and deselect in script
Hi there,
I am writing a function that will check if a field is empty and in that case select a checkbox from another field. Looking like this:
- void checkMissingData()
- {
- for each Adult_Record in Register
- {
- if(Adult_Record.Date_of_Birth == null)
- {
- if Adult_Record.Missing_Data.size() > 0
- {
- oldSelections = Adult_Record.Missing_Data;
- if (!oldSelections.contains("No DOB"))
- {
- oldSelections.add("No DOB");
- Adult_Record.Missing_Data = oldSelections;
- }
- }
- else
- {
- Adult_Record.Missing_Data = ("No DOB");
- }
- }
- }
- }
So if the Date_of_Birth field is empty (null), then the Missing_Data field checkbox No DOB will be checked.
But now I want to add an ELSE statement for that first IF. In other words if the Date_of_Birth field is not empty then the checkbox "No DOB" should be unchecked.
What is the opposite command of add in variable.add("value"); I tried remove but that's not it. And clear clears the whole field