You are here

function sf_prematch_form_alter in Salesforce Suite 7

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

Implementation of hook_form_alter().

File

sf_prematch/sf_prematch.module, line 58
Extends Salesforce API module so checks for an existing match for an object before creating a new one.

Code

function sf_prematch_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'salesforce_api_settings_form') {
    $form['sf_prematch'] = array(
      '#type' => 'fieldset',
      '#title' => t('Pre-creation prematching'),
      '#description' => t('Placeholder for any pre-creation matching settings.'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#weight' => -1,
    );
  }
  if ($form_id == 'salesforce_api_fieldmap_edit_form') {
    if (!array_search('sf_prematch_fieldmap_edit_form_submit', $form['#submit'])) {
      $form['#submit'][] = 'sf_prematch_fieldmap_edit_form_submit';
    }
  }
}