Currently this module creates the linkage between a Contact and an Opportunity via OpportunityContactRole. Ordinarily in Salesforce, however, each Opportunity (Donation) is also associated with an Account (Organization).
Probably it was done this way to support the Individual bucket account workflow of the Salesforce Nonprofit Starter Pack. However, as I look into what will be necessary in order to support Salesforce->QuickBooks integration (via https://sites.secure.force.com/appexchange/listingDetail?listingId=a0N30...), I am thinking it may be necessary for this module to provide the option to map an Opportunity via the Opportunity's Account Name field (which, despite its name, is actually an ID).
Earlier, before I got this module working, I had a preliminary version of this that did a SOQL query to pull up the Account ID for the Contact record based on the contact's first name and last name, and then provided that as a mappable field for an "Ubercart order". It might be more robust to do it by email address, though, since that will presumably almost always be mapped by users of the module.
If this were done, OpportunityContactRole mapping would be optional, since the Opportunities (Donations) would show up on the Account record. This would have benefits also for Salesforce reporting, such as roll-up summaries.
Related issue: #722402: Create a mapping for OpportunityLineItems in order to associate Products with a Opportunity.
Comments
Comment #1
EvanDonovan commentedCandidate for 6.x-1.0-alpha3 release, since this may be necessary for QuickBooks integration.
Comment #2
EvanDonovan commentedActually I won't need this feature for my integration, since I have created a way to create an Account & Contact prior to the creation of the Opportunity, and to track the Salesforce ID's of each, so that the Account ID can be added to the Opportunity. This is cleaner than having to do a SOQL lookup.
I'm going to leave this issue open, but mark as postponed. Someone else can work on the patch if they want. Probably the best place to add this would be in uc_sf_order_fieldmap_objects_alter()/_uc_sf_order_export_values().
Comment #3
EvanDonovan commentedA SOQL lookup would be more generalizable way to do this though. Ideally, it would be nice to be able to depend on another Salesforce integration module that provided a field type sort of like "fixed value" or "PHP" but which was just a SOQL query.
Comment #4
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.