Create record in Salesforce
Table of ContentsUp
Note: This task is applicable only to Zoho Creator.
Overview
Create a record in Salesforce using this task.
Syntax
where,
Parameter | Description | Data type | ||||||||
<variable> | is the variable which will contain the response returned by Salesforce. | KEY-VALUE | ||||||||
<salesforce_connection> | specifies the name of the Salesforce connection. | TEXT | ||||||||
<salesforce_module> | specifies the module in Salesforce where the record will be added. Following are the names of applicable modules.
| TEXT | ||||||||
<data_map> | Map with key as Salesforce field's name and the required value. For ex: {"Name":input.Name} To learn about the mandatory fields, click here and navigate to the required module on that page. | KEY-VALUE |
Creating a record in Salesforce
The following snippet when executed creates a record in the "Account" module in Salesforce.
response = salesforce.sales.create("Salesforce", "Account", accountinfo);
where,
Parameter | Description |
accountinfo | is a map variable that holds the key value pairs |
"Name" "BillingCity" "Type" "Industry" | are names of Salesforce fields |
input.First_Name input.City input.Type input.Industry | are Zoho Creator field inputs |
"Salesforce" | is the name of the Salesforce Connection |
"Account" | is the module in Salesforce, where the record will be created |
response | is response returned as map by Salesforce |
Response Format
Following is a sample success response returned by Salesforce:
"id":"00190000010xPIuAAM",
"errors":"[]",
"success":true
}
To get the ID of the newly created record, execute the following script:
The failure response returned, due to incorrect parameter value, is of the following format:
"message":"Cannot deserialize instance of currency from VALUE_STRING value thousand at [line:1, column:2]",
"errorCode":"JSON_PARSER_ERROR"
}