Checkbox select and deselect in script

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:
  1. void checkMissingData()
  2. {
  3. for each Adult_Record in Register
  4. {
  5. if(Adult_Record.Date_of_Birth == null)
  6.   {
  7. if Adult_Record.Missing_Data.size() > 0
  8. {
  9. oldSelections = Adult_Record.Missing_Data;
  10. if (!oldSelections.contains("No DOB"))
  11. {
  12. oldSelections.add("No DOB");
  13.                 Adult_Record.Missing_Data = oldSelections;
  14. }
  15. }
  16. else
  17. {
  18. Adult_Record.Missing_Data = ("No DOB");
  19. }
  20.   }
  21. }
  22. }

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


      • Topic Participants

      • mikis

      • Sticky Posts

      • How to Add Users to your Organization in ZohoMail?

        A better clarity so you can create other users to start using Zoho Mail. You can directly Add Users from the Control Panel to your Organization. You can invite users with the existing email address. If the person (user) already uses ZohoCRM, then you can import users from Zoho CRM. You can also import them using a .csv file. (if you are planning to add them in Bulk)  In this topic, We will be discussing on how to Add and Invite users only.  The Import options are self explanatory. ____________________________________________________________________________________________________________