Preview:
string related_list.same_company_Lead_related_list(Int Lead_ID)
{
// Info Lead_ID;
// get_leads_details = zoho.crm.getRecordById("Leads",3251014000113668043);
get_leads_details = invokeurl
[
	url :"https://www.zohoapis.com/crm/v2/Leads/" + Lead_ID + ""
	type :GET
	connection:"zoho_crm"
];
//info get_leads_details;
get_leads_details = get_leads_details.get("data").get(0);
email = get_leads_details.get("Email");
//info email;
index_email = email.indexOf("@");
email_substring = email.subString(index_email);
//info email_substring;
queryMap = Map();
queryMap.put("select_query","select Email,Company, First_Name, Last_Name, Lead_Source, Lead_Status  from Leads where Email like '%" + email_substring + "'");
response = invokeurl
[
	url :"https://www.zohoapis.com/crm/v3/coql"
	type :POST
	parameters:queryMap.toString()
	connection:"zoho_crm"
];
//info response;
responseXML = "<record>";
count = 0;
for each  data in response.get("data")
{
	lead_id = data.get("id");
	if(lead_id != Lead_ID)
	{
		Company = data.get("Company");
		First_name = data.get("First_Name");
		Last_name = data.get("Last_Name");
		full_name = concat(First_name," " + Last_name);
		info full_name;
		Email = data.get("Email");
		Lead_Source = data.get("Lead_Source");
		Lead_status = data.get("Lead_Status");
		responseXML = responseXML + "<row no='" + count + "'>";
		responseXML = responseXML + "<FL val='Lead Name' link='true' url='https://crm.zoho.com/crm/org667822476/tab/Leads/" + lead_id + "'>" + full_name + "</FL>";
		responseXML = responseXML + "<FL val='Email' link='true' url=''>" + Email + "</FL>";
		//	responseXML = responseXML + "<FL val='Customer'>" + customername + "</FL>";
		responseXML = responseXML + "<FL val='Lead Source'>" + Lead_Source + "</FL>";
		responseXML = responseXML + "<FL val='Lead Status'>" + Lead_status + "</FL>";
		// 		responseXML = responseXML + "<FL val='Date'>" + invoicedate + "</FL>";
		// 		responseXML = responseXML + "<FL val='Total'>$" + invoicetotal + "</FL>";
		// 		responseXML = responseXML + "<FL val='Balance'>$" + invoicebalance + "</FL>";
		responseXML = responseXML + "</row>";
		count = count + 1;
	}
}
responseXML = responseXML + "</record>";
return responseXML;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter