Inteygrate

Update Records in Salesforce from Zoho

Introduction

Muralidhar

Muralidhar

At inteygrate.com, I am trying out ways to integrate Salesforce to various other technologies.


zoho zoho crm salesforce integration

Update Records in Salesforce from Zoho

Posted by Muralidhar on .
Featured

zoho zoho crm salesforce integration

Update Records in Salesforce from Zoho

Posted by Muralidhar on .

The salesforce.sales.update() task is used to update a record in any of the supported modules in your Salesforce account, directly from your Zoho Creator application. To connect Zoho Creator with Salesforce, add a new connection from the Setup - Connections page.


Supported Modules

  • Account
  • Campaign
  • Case
  • Contact
  • Lead
  • Product
  • Solution

Syntax

<salesforceResponse> = salesforce.sales.update(  
                     <salesforceConnectionName>,  
                     <salesforceModuleName>,
                     <salesforceRecordID>,
                     <params>
);

Below is the description of each parameter,

Param Name Description
<salesforceResponse> It is the map variable returned as response. It contains the details of the newly created record.
<salesforceConnectionName> It referes to the connection name used to connect Zoho Creator with Salesforce
<salesforceModuleName> It refers to the module name in Salesforce where the record is created.
<salesforceRecordID> It refers to the ID of the record in Salesforce which needs to be updated.
<params> It is the map variable that holds the key,value pairs. The map key is the label name in the format as specified in Salesforce API. The map value is the field value as submitted from a Zoho Creator application.

Example

To edit a record in the accounts module, based on the given record ID, follow the below steps:

  1. Select the Form from your Dashboard page.
  2. Go to the required Form Actions block.
  3. Add the below script to the editor area.
  4. Click on Save Script to save the script definition.
getResponse = salesforce.sales.getRecords("Zoho","SELECT Name,Id FROM Account WHERE Name='Inteygrate'");  
recordListObj = getResponse.get("records");  
if (recordListObj != null){  
   recordList = recordListObj.toJSONList();
   id = "";
  for each recordObj in recordList{
    recmap = recordObj.toMap();
    id = recmap.get("Id");
  }
  if (id != ""){
    Details = map();
    Details.put("AnnualRevenue",100000);
    Details.put("Industry","Salesforce Technology");

   SalesforceResponse = salesforce.sales.update("Zoho", "Account", "id", Details);
  }
}

Response Format

The response returned by Salesforce will be in the format given below:

{"done":true}

If the execution fails due to incorrect parameter value,the response will be in the following format:

{
"message":"Cannot deserialize instance of currency from VALUE_STRING value thousand at [line:1, column:2]",
"errorCode":"JSON_PARSER_ERROR"
}


Using Script Builder

To add the script using the drag-n-drop functionality in Script Builder,

  1. Select the Form from your Dashboard page.
  2. Go to the required Form Actions block.
  3. Click on Scrip Builder from the top-right corner of the page.
  4. Drag and drop the call function in the editor box.
  5. Select Integration tasks.
  6. Select Service as Salesforce.
  7. Select Function as Update Record.
  8. Select the Connection Name to connect with Salesforce. Click on +Create to create a new connection or create a new connection from the Setup - Connections page.
  9. Select the required Module name in Salesforce.
  10. Insert the record ID of the record that needs to be updated in Salesforce.
  11. Select the map variable that holds the key-value pairs for the update request (or) click on "New Map" to add key-value pairs for the update request.
  12. Specify the response variable that will hold the response returned by Salesforce.
  13. Click on Done to insert the call function task.

Update Records in Salesforce from Zoho

Upon submission of the form, the specific record gets updated in Salesforce with the given values. The response variable will contain the response returned by Salesforce.


Muralidhar

Muralidhar

https://inteygrate.com

At inteygrate.com, I am trying out ways to integrate Salesforce to various other technologies.

View Comments...