You are here

function hook_salesforce_api_id_save_alter in Salesforce Suite 6.2

Same name and namespace in other branches
  1. 7.2 salesforce_api.api.php \hook_salesforce_api_id_save_alter()

Modify Salesforce IDs before they are saved to the {salesforce_object_map} table.

Parameters

$drupal_type: The type of the Drupal object you are requesting data for; node or user.

$oid: The associated unique ID used to identify the object in Drupal.

$sfid: The Salesforce ID of the associated object in the Salesforce database.

$name: The name of the fieldmap used to generate the export.

string $op_type: The operation being performed, 'import' or 'export'

Return value

TRUE if salesforce_api_id_save() should proceed with saving the link, FALSE otherwise

1 invocation of hook_salesforce_api_id_save_alter()
salesforce_api_id_save in salesforce_api/salesforce_api.module
Saves the Salesforce ID and fieldmap index of a Drupal object. This function will store the timestamp of creation of the object mapping It will also store data about when the object was last exported to Salesforce or imported to Drupal. *

File

./hooks.php, line 33
These are the hooks that are invoked by the Salesforce core.

Code

function hook_salesforce_api_id_save_alter(&$drupal_type, &$oid, &$sfid, &$name, &$op_type) {

  // Example: Do not allow a mapping to be saved between UID 1 and Salesforce
  if ($oid == 1 && $drupal_type == 'user') {
    return FALSE;
  }
}