Setting date field to null if string date value is empty or null
Hi,
I'm recollecting data from CRM and updating in Creator. Some fields could be empty - no problem with strings. But date fields, when they are null, I haven't found the correct way for setting them. I've tried like this:
r = zoho.crm.searchRecords("Contacts", "(Last Name|=|" + last_name + ")");
contact = r.get(0);
new_id = insert into Persona
[
Added_User = zoho.loginuser
... (more fields)
Fecha_Alta_Persona = if (c.get("Fecha Alta") != null, c.get("Fecha Alta").toDate(), null)
... (more fields)
];
But, it doesn't compile: "Both the expression should have same datatype".
Is it not possible to set null to date field?
Thank you very much,
Bernat