mp = {"Name":"Joe","Phone":"+1 678 XXX XXXX","Email":"joe@theworkflowacademy.com"};
response = zoho.crm.createRecord("Leads",mp,{"trigger":{"workflow"}});
Note: Change “Leads” and “mp” to the respective Module Name and map variable
To trigger assignment rules on record creation, first, you need to get the assignment rule ID (you can get it from the URL of the assignment rule), and put it in a map with “lar_id” as the key, and the assignment rule ID as the value. Then, insert it as a parameter at the end of your Deluge task.
response = zoho.crm.createRecord("Leads", mp, {"lar_id":"4409363000012741244"});
response = zoho.crm.createRecord("Leads", mp, {"trigger":{"workflow"},"lar_id":"4409363000012741244"});
datalist = List();
mp=Map();
mp.put("Lead_Status","Pre-Qualified"); //Insert your update map here
datalist.add(mp);
triglist = List();
triglist.add("workflow");
datamap = Map();
datamap.put("data",datalist);
datamap.put("trigger",triglist);
response = invokeurl
[
url:"https://www.zohoapis.com/crm/v2/Leads/"+leadid
type :PUT
parameters:datamap.toString()
connection:"crm_oauth_connection"
];
info response;
Note: Change “Leads” and “leadid” to the respective Module Name and Record ID variable
When deleting a record via the delete record API call, you need to add the wf_trigger=true parameter at the end of the URL.
response = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/Leads?ids=leadid&wf_trigger=true"
type: DELETE
connection:"crm_oauth_connection"
];
info response;
Click here to copy these scripts. For more Zoho-wizardry, check out our GitHub page. And, if you want to know how CRM stacks up against its competitors, check out our detailed HubSpot and Zoho CRM comparison.
Book a free 30-minutes consultation with a Zoho expert or send us an email