The salesforce.sales.create() task is used to add a record to 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
  • Case
  • Campaign
  • Contact
  • Lead
  • Product
  • Solution

Syntax

<salesforceResponse> = salesforce.sales.create(
                        <salesforceConnectionName>,
                        <salesforceModuleName>,
                        <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.
<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 create a record

To add a record to the accounts module, based on the values submitted from a Zoho Creator form, follow the below steps:

  1. Select the Form from your Dashboard page.
  2. Click on Settings - On Add - Actions on Success.
  3. Add the below script to the editor area.
  4. Click on Save Script to save the script definition.
//Declare Map Variable to hold the account details
Details = map();

//Add the account details to the map variable
Details.put("Name","Inteygrate");
Details.put("BillingCity","Hyderabad");
Details.put("Type","Prospect");
Details.put("Industry","Technology");

//creating the account in the Salesforce accounts module with connection name "Zoho"
salesforceResponse = salesforce.sales.create("Zoho", "Account", Details);

Response Format

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

{"id":"00128000013bBMB","errors":"[]","success":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. Click on Settings - On Add - Actions on Success
  3. Click on Script 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 Create 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. Select the map variable that holds the key-value pairs for the create request (or) click on "New Map" to add key-value pairs for the create request.
  11. Specify the response variable that will hold the response returned by Salesforce.
  12. Click on Done to insert the call function task.

Zoho Script Builder

Upon submission of the form, the record gets added to selected module in Salesforce. The response variable will contain the response returned by Salesforce.


You’ve successfully subscribed to inteygrate
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Your link has expired
Success! Check your email for magic link to sign-in.