I am linking a Lookup item called prospect in a module called Sample_Request (API=sample_req) from Leads.
I have created a button in Sample_Request to create a new Lead and use this button to create a new Lead.
This button allows a new Lead to be created by mapping the data in "sample_req".
At this time, I would like to include sample_req in the related list of Leads.
But it doesn't work.
I have created this code in another workflow and it does not fail, but it is not linked.
Any help would be appreciated to figure out what is wrong.
sampleRecords = zoho.crm.getRecordById("sample_req",listid);
//info sampleRecords;
name = ifnull(sampleRecords.get("Name"),"");
//info name;
Searchsample = zoho.crm.searchRecords("leads","(Last_Name:equals:" + name + ")");
if(Searchsample.size() > 0)
{
leadId = Searchsample.get(0).get("id");
mp = Map();
mp.put("Leads",leadId.toLong());
linkLeadToSample = zoho.crm.updateRelatedRecord("leads",leadId.toLong(), "sample_req",listid.toLong(),mp);
info linkLeadToSample; }
}
info Searchsample; }
info leadId;