I am currently working on a solution to this issue. I am posting this both so folks know that I am doing so, and to solicit feedback on my proposed solution.

When exporting a Drupal object for the first time, we need a mechanism to first see if we can find a match for that object in salesforce before creating a new object in salesforce. That way we can minimize the creation of duplicates in salesforce. (The same problem exists when importing, but I am not attempting to tackle that, at least not yet.)

In order to find a match, we need to know what field(s) to try to match upon.

I propose we allow the administrator to select up to three of a field map's mapped fields for matching: i.e. a primary, secondary, and tertiary field. Thus, for example, when trying to find a contact which matches a content_profile node, we might use email address, last name, and first name.

Because mismatches can result in corrupted data, we want to give administrators the ability to manage how much precision goes into matching. I propose the following options:

Only consider a match if the found object matches (select control with the following choices)
primary, secondary and tertiary fields
primary and secondary fields
primary field
primary field OR (secondary and tertiary fields)

In my view, this is part of core functionality for this module, and thus should be implemented as a patch of the current API module. However, I am open to being told that I should develop it as a separate module. To be clear, here are the key things I think turn on whether it is a patch or separate.

If implemented as a patch, the code for attempting to match can be made part of the API module. If not, a hook will need to be added to the API module so that other module(s) can implement attempted matching.

If implemented as a patch, submitting the edit field map form would automatically take users to the form outlined above. If not, users will have to click a separate menu item to get there. Further, if the form is not integrated, it will have to have a first page where the user chooses which field map they are editing whereas that would be known if it is implemented as a patch.

If implemented as a patch, the data can be stored in the salesforce_field_map table. If not, a new table will be needed.

I appreciate any feedback both in terms of the general approach, and in terms of whether or not implementation as a patch is preferred.

Comments

Sid_M’s picture

Status: Active » Closed (fixed)

http://drupal.org/node/507800 supersedes this issue.