The salesforce.sales.getRecordById() task is used to get records from any of the supported modules in your Salesforce account, by specifying the unique ID of the record. To connect Zoho Creator with Salesforce, create a new connection from the Setup - Connections page.

Supported Modules

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

Syntax

<salesforceResponse> = salesforce.sales.getRecordById(
                     <salesforceConnectionName>,
                     <salesforceModuleName>,
                     <recordID>
);

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 record that needs to be fetched.
<salesforceConnectionName> It refers to the connection name used to connect Zoho Creator with Salesforce
<salesforceModuleName> It refers to the module name in Salesforce from where the record is fetched
<recordID> It is the ID of the record in Salesforce that needs to be fetched

Example - Fetch Records by ID

To fetch a record from the accounts module based on the recordID, 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.
salesforceResonse = salesforce.sales.getRecordById("Zoho", "Account", "00128000013bBMB");

Response Format

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

{ "UpsellOpportunity__c":null,
"ParentId":null,
"Phone":null,
"TickerSymbol":null,
"SLAExpirationDate__c":null,
"Type":"Prospect",
"OwnerId":"00768000001h8THBBZ",
"LastModifiedDate":"2016-12-10T09:58:31.000+0000",
"ShippingState":null,
"AnnualRevenue":1000,
"BillingState":null,
"NumberofLocations__c":null,
"LastActivityDate":null,
"NumberOfEmployees":null,
"BillingPostalCode":null,
"SLASerialNumber__c":null,
"SystemModstamp":"2016-12-10T09:58:31.000+0000",
"ShippingCity":null,
"Description":null,
"BillingCountry":null,
"Site":null,
"ShippingCountry":null,
"LastModifiedById":"00768000001h8THBBZ",
"Website":null,
"ShippingStreet":null,
"AccountNumber":null,
"Fax":null,
"BillingStreet":null,
"SLA__c":null,
"Active__c":null,
"CustomerPriority__c":null,
"MasterRecordId":null,
"Name":"Inteygrate",
"BillingCity": "Hyderabad",
"Rating":null,
"CreatedById":"00768000001h8THBBZ",
"CreatedDate":"2016-12-10T09:58:31.000+0000",
"IsDeleted":false,
"Id":"00128000013bBMB",
"Ownership":null,
"attributes":"{
 "type":"Account",
 "url":"/services/data/v20.0/sobjects/Account/00128000013bBMB"
}",
"ShippingPostalCode":null,
"Sic":null,
"Industry":"Technology"
}

If the execution fails due to Malformed Query, the response will be in the following format:

{
"message":"\nSELECT * FROM Account where Name='Inteygrate'\n ^\nERROR at Row:1:Column:7\nunexpected token: '*'",
"errorCode":"MALFORMED_QUERY"
}

##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.
    Click on Script Builder from the top-right corner of the page.
  3. Drag and drop the call function in the editor box.
  4. Select Integration tasks.
  5. Select Service as Salesforce.
  6. Select Function as Get Record by ID.
  7. Select the Connection Name to connect with Salesforce.
  8. Click on +Create to create a new connection or create a new connection from the Setup - Connections page.
  9. Select the module name in Salesforce.
  10. Insert the record ID of the record that needs to be fetched.
  11. Specify the response variable that will hold the response returned by Salesforce.
  12. Click on Done to insert the call function task.

Script to Fetch record by ID in Zoho from Salesforce

Upon submission of the form, the specific record gets fetched from Salesforce based on the given recordID. 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.