Fetch record by ID

Fetch record by ID from Salesforce

Overview

Fetch a record from Salesforce by specifying the record ID.

Note: This task is applicable only to Zoho Creator.

Syntax

<variable> = salesforce.sales.getRecordById(<salesforce_connection>, <salesforce_module><record_ID>);

where,

ParameterDescriptionData type

<variable> 

is a variable which will hold the response returned by Salesforce.

KEY-VALUE

<salesforce_connection> 

is the name of the Salesforce connection.

TEXT

<salesforce_module>

is the name of the module in Salesforce from where the record will be fetched.

Following are the names of applicable modules.

Lead

Account

Contact

Case
SolutionProduct   Campaign
TEXT

<record_ID>

ID of the record which needs to be fetched.

Learn how to fetch the ID of a record after creating it or fetching it.

TEXT

Fetch record by ID from Salesforce

The following snippet when executed fetches a record based on the specified record ID from the "Account" module in Salesforce. 

response = salesforce.sales.getRecordById("Salesforce", "Account", "00190000010bRIMAA2");

where,

ParameterDescription
"Salesforce"is the name of the Salesforce Connection
"Account"is the module in Salesforce, from where the record will be fetched
"00190000010bRIMAA2​"is the ID of the record which needs to be fetched
responseis response returned as map by Salesforce

Sample Response

Following is a sample success response returned by Salesforce:

{  
   "UpsellOpportunity__c":null,
   "ParentId":null,
   "Phone":null,
   "TickerSymbol":null,
   "SLAExpirationDate__c":null,
   "Type":null,
   "OwnerId":"00590000002l9KTAAY",
   "LastModifiedDate":"2014-08-06T09:58:31.000+0000",
   "ShippingState":null,
   "AnnualRevenue":1000,
   "BillingState":null,
   "NumberofLocations__c":null,
   "LastActivityDate":null,
   "NumberOfEmployees":null,
   "BillingPostalCode":null,
   "SLASerialNumber__c":null,
   "SystemModstamp":"2014-08-06T09:58:31.000+0000",
   "ShippingCity":null,
   "Description":null,
   "BillingCountry":null,
   "Site":null,
   "ShippingCountry":null,
   "LastModifiedById":"00590000002l9KTAAY",
   "Website":null,
   "ShippingStreet":null,
   "AccountNumber":null,
   "Fax":null,
   "BillingStreet":null,
   "SLA__c":null,
   "Active__c":null,
   "CustomerPriority__c":null,
   "MasterRecordId":null,
   "Name":"feb",
   "BillingCity":null,
   "Rating":null,
   "CreatedById":"00590000002l9KTAAY",
   "CreatedDate":"2014-08-06T09:58:31.000+0000",
   "IsDeleted":false,
   "Id":"00190000010xPIuAAM",
   "Ownership":null,
   "attributes":"{"   type":"Account",
   "url":"/services/data/v20.0/sobjects/Account/00190000010xPIuAAM"
}","ShippingPostalCode":null,
"Sic":null,
"Industry":"Chemicals"
}

The following is a sample failure response, due to incorrect query:

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

Related Links

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com