ZOHO.CRM.CONNECTOR.authorize(nameSpace) |
ZOHO.CRM.CONNECTOR.invokeAPI(nameSpace, data) |
Name | Type | Description |
Variables | Object | The dynamic data is represented by placeholders in the connector API. |
Content_Type | Object | ContentType - multipart for multipart request. |
Parts | Array | For a multipart request, provide the parts configuration details here. |
File | Object | To include a file in your multipart request. |
Util={}; var EntityId; var EntityName; var recordInfo; var emailid; //Subscribe to the EmbeddedApp onPageLoad event before initializing the widget ZOHO.embeddedApp.on("PageLoad",function(data) { /*Prompts the authorization window of the "GoogleEventsCalendar" connector to establish integration between Zoho CRM and GoogleCalendar*/ ZOHO.CRM.CONNECTOR.authorize("jssdkextension.googleeventscalendar").then(function(data1){ }) }) /*To create an event by retrieving the input values of start date, end date, and summary and passing it as a constructed data set to the 'InvokeAPI' method*/ Util.create=function() { //Fetching the record details and retrieving the mail ID of the lead ZOHO.CRM.API.getRecord({Entity:EntityName,RecordID:EntityId}) .then(function(data){ recordInfo=data; emailid=recordInfo.data[0].Email; //Retrieving the input values var title=document.getElementById("summary").value; var startdate = document.getElementById("startdate").value; var enddate = document.getElementById("enddate").value; //Constructing the data set var x = { "Start":startdate, "End":enddate, "Title":title, "Email":emailid } //Invoking the 'CreateNewEvent' API by passing the constructed data set ZOHO.CRM.CONNECTOR.invokeAPI("jssdkextension.googleeventscalendar.creatnewevent",x) .then(function(responsedata){ }) }) } |
Writer is a powerful online word processor, designed for collaborative work.