Update Date Field

Update Date Field

Hello

I am trying to update a field with a date. Sounds simple enough, right!

I have a field named “Lead Type” with two options Low Priority and High Priority and I would like to update a field named “Closing Date”. I would like to add a date to the field “Closing Date” dependent on whether the “Lead Type” field is set to, Low Priority or High Priority.

I am trying to set:

(“Lead Type” = Low Priority) set (“Closing Date” = Today’s date + 5 days)

(“Lead Type” = High Priority) set (“Closing Date” = Today’s date + 15 days)

 

Code:

  1. void SetClosingDate ( date Closing_Date ) Edit Arguments
    1. if(Lead Type = Low Priority);

      {

      input.Closing_Date = zoho.currentdate.addDay(5);

      }

      else if(Lead Type = High Priority);

      {

      input.Closing_Date = zoho.currentdate.addDay(15);

      }

      end;

      respond = zoho.crm.updateRecord("Potentials",Closing_Date;

I would appreciate any help and I thank you in advance.