For my current project I have a profile content type that has two field maps, one for a Salesforce lead and one for a Contact. The requirements of the project require that when a new profile is created or updated we first check if there is a matching Salesforce Contact and connect/update the Drupal record to the Salesforce record. If no matching Contact exists in Salesforce we need to then check for a matching Lead, and either connect and update or insert a new Lead in Salesforce. We don't ever want to create a Contact (which is the first fieldmap on this content type).
On line 128 of sf_node_nodeapi() the module just grabs the first fieldmap for a node type that is available to use for exporting. All others are discarded. I can't use the module settings for "Create" and "Insert", as I want both fieldmaps to be in play for both node insert and update events. So I don't see any way to support this edge case with the module other than allowing modules to jump in and alter $maps just before sf_node_nodeapi() pulls the first map.
If there is another way to do this, please let me know and I will close this issue. I have a patch for that adds this functionality and will attach next.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | salesforce-hook_for_node_map_changes_in_export-1870594-1.patch | 1.18 KB | jemond |
Comments
Comment #1
jemond commentedPatch attached that adds a new hook to sf_node_nodeapi() to allow modules to alter the node's fieldmaps ($maps).
Comment #2
aaronbaumanclosing all 6.x issues