Closed (won't fix)
Project:
Salesforce Suite
Version:
7.x-3.x-dev
Component:
salesforce_pull.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2015 at 02:49 UTC
Updated:
21 Feb 2026 at 19:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
arlina commentedPatch with an initial implementation of this functionality, against the current 7.x-3x branch. It will look up an entity using entity field query that matches with the mapping key field value from salesforce.
Comment #3
aaronbaumanThis is cool.
In this scenario the upsert-to-SF key is the same as the pull-to-Drupal key.
Is there an argument to be made that they should be separable?
Does this work for obvious cases, like user uid and user email?
Comment #4
labboy0276 commentedThis patch does work well, however, it causes a strict warning:
Attached is a patch that makes the error go away.
Comment #5
labboy0276 commentedAlso, outside of the scope of the patch above. if you want to pull by email and not username, you can change this in the patch above:
to
As the client we were working on used the email registration module and not every SF record had the Website_Username__c in it. So this patch is great in general, but we had to tweak it some. Just putting thing here if anyone else runs into the issue we had, not 100% sure I want to put the patch unless requested for this use case.
Comment #6
aaronbaumanThank you for your work on the patch.
I have no doubt that some folks will want to apply this functionality.
But, since it's a potentially major change to existing behavior, there are two big things that need to change before this could be committed:
1. Make this more configurable (and extensible).
Allow admins to choose whether or not to match existing entities when pulling.
Allow other modules to alter match criteria at runtime.
2. Don't change existing behavior.
(perhaps by defaulting to the "off" configuration in #1).
Comment #7
nottaken commentedThis seems related to another issue about externalId and idLookup for matching? https://www.drupal.org/node/1951728
Comment #8
damienmckenna@labboy0276: For your use case, did you set the email field to be the key?
Comment #9
damienmckennaRerolled.
Comment #10
damienmckennaThis appears to be working for me on user entities, it has changed from creating duplicate records for every record that wasn't previously downloaded (would have been all 45k of them) to updating the records. Also, in the mapping definition the email field is set as "key" and it seems to be able to work from that automatically, no extra changes necessary.
Comment #11
damienmckennaClarified the title.
Comment #12
damienmckennaThere should only be one record for each primary key, so to allow more than one is a bug.
Comment #13
damienmckennaI suspect this may be creating a problem I'm seeing - it's trying to create duplicate records in salesforce_mapping_object.
Comment #14
gcbIs this the same issue as https://www.drupal.org/node/2230599?
Comment #15
aaronbauman7.x is no longer supported