Custom fuction amelioration

Custom fuction amelioration

Hi all,

I have this custom module ''CLG'' and ''Account'' module.

In ''CLG'', I have a date field named ''CLG - Deactivation Date'' ; in ''Account'' I have a date field named the same ''CLG - Deactivation Date''.

I have a workflow, every time a ''CLG'' is edited, it's launch this custom function :

Name ValueAccountName=  CLG.Dealer Name
deactivate=  CLG.CLG - Deactivation Date

respAccount = zoho.crm.searchRecords(("Accounts"),(("(Account Name|=|") + input.AccountName) + ")",1,5);
info respAccount;
for each a in respAccount
{
mp=map();
mp.put("CLG - Deactivation Date",input.deactivate);
update = zoho.crm.updateRecord(("Accounts"),a.get("ACCOUNTID"),mp);
}

So far, so good, when I entered a date in the ''CLG'' module in '' CLG - Deactivation Date'', it changes automatically the date in the related ''Account''.
But, when I erase the date in the ''CLG'', well nothing happen, the date stay the same isn't changed in ''Account'' module.
I'd need them to be always the same (same date, or empty).

Can you help me re-write my custom function to achieve this ?

Thank you,