function salesforce_api_fieldmap_clone in Salesforce Suite 7.2
Same name and namespace in other branches
- 5.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_clone()
- 6.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_clone()
- 7 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_clone()
Clones a fieldmap.
Parameters
$fieldmap: The index or name of the fieldmap to clone.
Return value
The newly created fieldmap or FALSE if the clone failed.
1 call to salesforce_api_fieldmap_clone()
- salesforce_api_fieldmap_clone_form_submit in salesforce_api/
salesforce_api.admin.inc - Submit handler for the fieldmap clone form.
File
- salesforce_api/
salesforce_api.module, line 788 - Defines an API that enables modules to interact with the Salesforce server.
Code
function salesforce_api_fieldmap_clone($fieldmap) {
// Load the fieldmap from the database.
$map = salesforce_api_salesforce_fieldmap_load($fieldmap);
// Return FALSE if the source fieldmap does not exist.
if (empty($map)) {
return FALSE;
}
// Save the old fieldmap ids, save new ones, and return it.
unset($map->fieldmap, $map->name);
salesforce_api_fieldmap_save($map);
return !empty($map->name) ? $map : FALSE;
}