You are here

function hook_sf_notifications_check_condition in Salesforce Suite 7.2

Indicate whether a notification should be processed.

This hook is invoked prior to processing each incoming notification from Salesforce. You may use this hook to set conditions under which a notification will be processed. Notifications failing these conditions will not trigger this fieldmap. This may be particularly useful in the case of Salesforce objects that are mapped to multiple Drupal objects.

Parameters

$operation: The operation being performed. Either "insert", "update", or "delete".

$object_record: The object record we are performing the operation on. An array with the following keys:

  • oid: The drupal object id of the object we are operating on. NULL if $operation is 'insert'.
  • name: The name of the fieldmap to be used.
  • drupal_entity: The entity type this object should be inserted as.
  • drupal_bundle: The bundle this object should be inserted as.
  • fields: The fields provided in the incoming Salesforce notification.
  • operation: The operation we are performing. The same as the $operation parameter.

$map: The fieldmap object containing the fieldmap we want to use.

Return value

Boolean TRUE or FALSE depending on whether this object should be processed or not.

1 invocation of hook_sf_notifications_check_condition()
_sf_notifications_handle_message in sf_notifications/sf_notifications.module
Loop through an array of SObjects from Salesforce and save them according to any existing sf fieldmaps, notification settings, and data.

File

sf_notifications/sf_notifications.api.php, line 44
These are the hooks that are invoked by the Salesforce Notifications module.

Code

function hook_sf_notifications_check_condition($operation, $object_record, $map) {
  switch ($operation) {
    case "insert":
    case "update":
      return TRUE;
    default:
      return FALSE;
  }
}