Reading Time: 1 minute

Returns a Salesforce object (e.g., lead or contact) you specify containing the Salesforce ID of a record if a match is found.


salesforce.searchObject(salesforceURL: string, accessToken: string, searchParams: object, callback: Function)


The url of your Salesforce instance (e.g.,:

A valid access token which grants access to your Salesforce instance. It can be generated using the getAccessToken method.

An object in which you can specify the following parameter values: searchValue, salesforceObject, searchIn. (SearchIn field may contain: ALL, NAME, EMAIL, PHONE, or SIDEBAR values.)

Receives the result of the search as parameter when a match is found. In the body of the function, set the value of the returned object’s Salesforce ID to your Salesforce field that was created during the setup procedure. (E.g., vcc.setFieldValue(‘salesforce_id’, result.searchRecords[0].Id); )

Return values

Returns a Salesforce object (e.g., a lead or contact) you specify if a match is found based on the phone number.


function showLeadInSalesforce(phoneNumber) {
  salesforce.getAccessToken(config, 'api', function(accessToken) {
      token = accessToken;
         searchParams = {
          'searchValue': phoneNumber,
          'salesforceObject': 'Lead',
          'searchIn': 'PHONE'
    salesforce.searchObject('', accessToken, searchParams, function(result) {
      if (result.searchRecords[0].Id) {
          leadId = result.searchRecords[0].Id;
        vcc.setFieldValue('salesforce_id', result.searchRecords[0].Id);


$().onLoad = function() {
  const phone = vcc.getFieldValue('phone1')

There are no comments yet.
Subscribe to our newsletter
or Contact us!
Please note that by subscribing to our newsletter, you agree to receive regular email messages from VCC Live® about service related news and updates. By subscribing to our newsletter, you also agree that VCC Live® will use your data in accordance with the applicable Privacy Policy until you unsubscribe from the newsletter.