You are here

function salesforce_api_fieldmap_save in Salesforce Suite 6.2

Same name and namespace in other branches
  1. 5.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_save()
  2. 7 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_save()
  3. 7.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_save()

Saves a fieldmap to the database.


$map;: An array containing the fieldmap data using the following keys and values:

  • fieldmap: the numeric index of the fieldmap.
  • drupal: the name of a Drupal object.
  • salesforce: the name of a Salesforce object.
  • automatic: whether or not the sync should be automatic
  • description: a short title or description of the fieldmap
  • fields: an array that maps source fields (as keys) to their corresponding target fields (as values).
7 calls to salesforce_api_fieldmap_save()
salesforce_api_fieldmap_clone in salesforce_api/salesforce_api.module
Clones a fieldmap.
salesforce_api_fieldmap_create in salesforce_api/
Creates a new fieldmap in the database and returns its index.
salesforce_api_fieldmap_edit_form_submit in salesforce_api/
FAPI submit handler for fieldmap editor
salesforce_api_fieldmap_field_delete in salesforce_api/salesforce_api.module
Remove a field from all fieldmaps. This is particularly useful for implementations of hook_content_fieldapi('delete instance'). May be use to delete an occurence in a single fieldmap (by supplying drupal_type and/or salesforce_type), or…
salesforce_api_fieldmap_remove_field in salesforce_api/
Given a fieldmap name and a field, remove the field from the fieldmap. Redirect to the fieldmap edit page unless specified.

... See full list


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


function salesforce_api_fieldmap_save(&$map) {
  if (!empty($map->fieldmap)) {
    $primary_key = 'name';
  if (empty($map->name)) {
    $map->name = md5(microtime());
  drupal_write_record('salesforce_field_map', $map, $primary_key);