function salesforce_api_fieldmap_field_options in Salesforce Suite 7.2
Same name and namespace in other branches
- 5.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_field_options()
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_field_options()
- 7 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_field_options()
Returns a FAPI options array for specifying a field from the source object to associate with the target field.
Parameters
$object: The source object whose fields we need to filter into the options array.
$type: The type of the target field's object.
$name: The name of the target object.
$field: The name of the target field.
Return value
A FAPI options array of all the available fields that can map to the target field.
1 call to salesforce_api_fieldmap_field_options()
- salesforce_api_fieldmap_edit_form in salesforce_api/
salesforce_api.admin.inc
File
- salesforce_api/
salesforce_api.module, line 1034 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_fieldmap_field_options($object, $type = NULL, $name = NULL, $field = NULL) {
// Define the options array.
// (Don't add a blank value - we don't want that to be selectable in the fieldmapping UI.)
$options = array();
// TODO: Consider filtering these based on the object definition. For now
// this function simply uses any field defined for the source object.
// Loop through all the fields of the source object.
foreach ($object['fields'] as $key => $data) {
// Add the field to the options array in the right options group.
if (!empty($data['group'])) {
$options[$data['group']][$key] = $data['label'];
}
else {
$options[t('Core fields')][$key] = $data['label'];
}
}
return $options;
}