void workflowspace.LeadsScoring(int Leadid,string Scorefield)
{
leadIDStr=input.Leadid.toString();
resp = zoho.crm.getRecordById("Leads",input.Leadid);
respStr=resp.toString();
respMap=respStr.toMap();
phone=ifnull(respMap.get("Phone"),"0");
email=ifnull(respMap.get("Email"),"0");
title=ifnull(respMap.get("Title"),"0");
website=ifnull(respMap.get("Website"),"0");
industry=ifnull(respMap.get("Industry"),"0");
point=0;
if(phone.length() > 9)
{
point=2;
}
if(!((email.contains("gmail") || email.contains("yahoo")) || email.contains("outlook")))
{
point=(point + 2);
}
if((website != null) || (website != ""))
{
point=(point + 2);
}
if(((title.contains("CEO") || title.contains("manager")) || title.contains("dir")) || title.contains("VP"))
{
point=(point + 2);
}
if(industry.contains("ERP"))
{
point=(point + 2);
}
/////////////////////////////////////
info point;
if(point >= 9)
{
Score="*****";
}
else if(point >= 7)
{
Score="****";
}
else if(point >= 5)
{
Score="***";
}
else
{
Score="";
}
info Score;
upresp = zoho.crm.updateRecord("Leads",leadIDStr,{ input.Scorefield : Score });
//info upresp;
}
Note: This custom is for the leads module and you can change the custom function for other modules also.
Please refer to the following link to know more about this feature:
Sincerely,
Prakash