deal = zoho.crm.getRecordById("Deals",DealId);
info deal;
// customization block:
// replace your client id and api key here
// you can find the client id and api key in Ideolve console - Profile - Connect to other apps - Select Zoho CRM - choose tab : Configure ZohoCRM
connectorClientId = "replace your client id here"
apiKey = "replace your api key here"
keys = {"Owner","Created_By","Created_Time","Account_Name","id","Deal_Name","Description","Last_Activity_Time","Modified_By","Modified_Time","Stage","review_process"};
notetext = "#Deal";
for each key in keys
{
keyvalue = deal.get(key);
if(!keyvalue.isNull())
{
info keyvalue;
notetext = notetext + "
" + key + " : " + keyvalue;
}
}
tags = "";
tagList = deal.getJSON("Tag");
for each tag in tagList
{
tags = tags + tag.get("name");
tags = tags + ", ";
}
if(tags != "")
{
notetext = notetext + "
Tags : " + tags;
}
sub = "Deal | Acc Name : " + deal.get("Account_Name").get("name") + " | " + deal.get("Deal_Name") + " | " + DealId;
// We surely need - owner, description, dates, stage, relation to account, contact details, created by
// notetext = "#Deal
Owner: " + deal.get("Owner") + "
Created By: " + deal.get("Created_By") + "
Created Time: " + deal.get("Created_Time") + "
Account Name: " + deal.get("Account_Name") + "
Id: " + deal.get("id") + "
Deal Name: " + deal.get("Deal_Name") + "
Description: " + deal.get("Description") + "
Last Activity Time: " + deal.get("Last_Activity_Time") + "
Modified By: " + deal.get("Modified_By") + "
Modified Time" + deal.get("Modified_Time") + "
Stage: " + deal.get("Stage") + "
Review Process: " + deal.get("review_process");
header = {"event-origin":"ZohoCRM","event-type":"AddNote","connector-client-id":connectorClientId,"x-api-key":apiKey,"Content-Type":"application/json"};
bodyMp = {"subject":sub,"notehtmltext":notetext,"readonly":true,"leadNo":DealId.toString(),"module":"Deals","users":{"sharewith":{{"group":"CRM"},{"group":"Deployment"}}}};
response = invokeurl
[
url :"https://api.ideolve.com/v3/connector/event"
type :POST
parameters:bodyMp.toString()
headers:header
];
info response;