Get Old Owner of zoho crm record
Get Old Owner of zoho crm record
Hello Team
Sample code:-
Getrecord = invokeurl
[
url: "
https://www.zohoapis.com/crm/v5/Leads/"+Lead_ID+"/__timeline"
type: GET
connection: "zcrm"
];
if(Getrecord.get("__timeline").size() > 0)
{
for each rec in Getrecord.get("__timeline")
{
if(rec.get("field_history") != null && rec.get("field_history").getJSON("api_name") == "Owner")
{
OwnerNew = rec.get("field_history").getJSON("_value").getJSON("new");
OwnerOld = rec.get("field_history").getJSON("_value").getJSON("old");
//..........here apply the user Api and get the owner ID..........
}
}
}
here in the
Lead_ID
you have to just pass the record lead id and new owner and old owner will be there
Thanks & Regards
Piyush Goyal
LinkedIn
Zoho Developer || 3+ years Experience
+91- 8619164837