Workflow doesn't detect update from custom function

Workflow doesn't detect update from custom function

Hi,

I am trying to apply a tag to a Contact based on a field that is updated through a function that captures data from a custom module.

I created this workflow (see attachment) but nothing is happening. It looks like Zoho doesn’t know that the Contact is edited when the custom function updates the field “Last Ride date”.

The workflow works fine when I edit any field and save the Contact. But that won’t work for me. I need this action (apply the tag) to be automatic.

In an earlier conversation, I was advised to add the trigger workflow option to your custom function : Sample response = zoho.crm.updateRecord("Contacts", recordId, contactMap, {"trigger":{"workflow"}});

I ended up with the follow function, but it didn't work for me because I didn't know how to define the variable recordId.

However, I need to apply different tags (one replaces another) based on the custom data, so I don't know if adding a line to the custom function will do since I should have 6 different tags.

custinfo = zoho.crm.getRecordById("Vingo_Ride",custid.toLong());
ctime = custinfo.get("Ride_date");
relcont = zoho.crm.searchRecords("Contacts","(Email:equals:" + email + ")");
if(relcont.size() > 0)
{
for each rec in relcont
{
contid = rec.getJSON("id");
break;
}
update = zoho.crm.updateRecord("Contacts",contid.toLong(),{"Last_Ride_date":ctime.toDate()});
update1 = zoho.crm.updateRecord("Vingo_Rides",custid.toLong(),{"Contacts_Name":contid.toLong()});
response = zoho.crm.updateRecord("Contacts", recordId, contactMap, {"trigger":{"Apply Inactive 6D tag"}});


}

Thank you,