account = zoho.crm.getRecordById("Accounts",AccountId);
// 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"
sub = "ACC | " + account.get("Account_Name") + " | " + AccountId;
tags = "";
tagList = account.getJSON("Tag");
for each tag in tagList
{
tags = tags + tag.get("name");
tags = tags + ", ";
}
em = zoho.crm.getRelatedRecords("Contacts","Accounts",AccountId,1,200,{"type":1});
contacts = "";
for each con in em
{
info con;
email = con.getJSON("Email");
contacts = contacts + "
" + email;
}
notetext = "#Account
Owner: " + account.get("Owner") + "
Account Status: " + account.get("Account_Status") + "
Account Type: " + account.get("Account_Type") + "
Industry: " + account.get("Industry") + "
Parent Account: " + account.get("Parent_Account") + "
Annual Revenue: " + account.get("Annual_Revenue") + "
Employees: " + account.get("Employees") + "
Website: " + account.get("Website") + "
Fax: " + account.get("Fax") + "
Phone: " + account.get("Phone") + "
Rating: " + account.get("Rating") + "
SIC code: " + account.get("SIC_Code") + "
Name Partner: " + account.get("Name_Partner") + "
Name Distributor: " + account.get("Name_Distributor") + "
Currency: " + account.get("Currency") + "
Mithi Products: " + account.get("Mithi_Products") + "
Tags: " + tags.toString() + "
Address Info
Billing Address
Billing Street: " + account.get("Billing_Street") + "
Billing City: " + account.get("Billing_City") + "
Billing State: " + account.get("Billing_State") + "
Billing Code: " + account.get("Billing_Code") + "
Billing Country: " + account.get("Billing_Country") + "
Shipping Address
Shipping Street: " + account.get("Shipping_Street") + "
Shipping City: " + account.get("Shipping_City") + "
Shipping State: " + account.get("Shipping_State") + "
Shipping Code: " + account.get("Shipping_Code") + "
Shipping Country: " + account.get("Shipping_Country") + "
Description: " + account.get("Description") + "
Account Contacts:" + contacts;
header = {"event-origin":"ZohoCRM","event-type":"UpdateNote","connector-client-id":connectorClientId,"x-api-key":apiKey,"Content-Type":"application/json"};
bodyMp = {"subject":sub,"notehtmltext":notetext,"readonly":true,"leadNo":AccountId.toString(),"module":"Accounts"};
response = invokeurl
[
url :"https://api.ideolve.com/v3/connector/event"
type :POST
parameters:bodyMp.toString()
headers:header
];
info response;