You are here

function drush_salesforce_sf_read_object in Salesforce Suite 7.3

Same name and namespace in other branches
  1. 8.4 salesforce.drush.inc \drush_salesforce_sf_read_object()
  2. 8.3 salesforce.drush.inc \drush_salesforce_sf_read_object()
  3. 5.0.x salesforce.drush.inc \drush_salesforce_sf_read_object()

Read a Salesforce object available to the logged-in user.

Parameters

$name: The object type name, e.g. Account

$id: The Salesforce ID

File

./salesforce.drush.inc, line 261
Drush integration for Salesforce.

Code

function drush_salesforce_sf_read_object($name, $id) {
  $salesforce = _drush_salesforce_drush_get_api();
  try {
    if ($object = $salesforce
      ->objectRead($name, $id)) {
      drush_print(drush_format($object));
    }
  } catch (SalesforceException $e) {
    drush_log($e
      ->getMessage(), 'error');
  }
}