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.

Comments

jemond’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

Patch attached that adds a new hook to sf_node_nodeapi() to allow modules to alter the node's fieldmaps ($maps).

aaronbauman’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

closing all 6.x issues