You are here

function salesforce_api_describeGlobal in Salesforce Suite 7

Same name and namespace in other branches
  1. 6.2 salesforce_api/salesforce_api.module \salesforce_api_describeGlobal()
  2. 7.2 salesforce_api/salesforce_api.module \salesforce_api_describeGlobal()

Wrapper for SOAP SforceBaseClient::describeGlobal

Return value

an SFQueryResult object (look at ->types for an array of SF object types)

3 calls to salesforce_api_describeGlobal()
salesforce_api_admin_object in salesforce_api/salesforce_api.admin.inc
Ask salesforce for a list of objects and display a checklist for the user. Based on user selection, set up or tear down cached/synched Salesforce data. @TODO make this more user friendly. At the moment it's possible for an admin user to blow…
salesforce_api_demo in salesforce_api/salesforce_api.admin.inc
Demonstrates some of the API functionality through the Salesforce class and fieldmap functionality.
salesforce_api_drush_show_tables in salesforce_api/salesforce_api.drush.inc
Duplicates the functionality of mysql's SHOW TABLES

File

salesforce_api/salesforce_api.module, line 852
Defines an API that enables modules to interact with the Salesforce server.

Code

function salesforce_api_describeGlobal() {
  static $response;
  if (!empty($response)) {
    return $response;
  }
  $sf = salesforce_api_connect();
  if ($sf === FALSE) {
    $link = l('Please verify that you have completed your SalesForce credentials', SALESFORCE_PATH_ADMIN);
    drupal_set_message(t('Unable to connect to SalesForce. !link', array(
      '!link' => $link,
    )), 'error');
    return;
  }
  $response = $sf->client
    ->describeGlobal();
  if (isset($response->sobjects)) {
    $response->types = $response->sobjects;
    unset($response->sobjects);
  }
  return $response;
}