Closed (won't fix)
Project:
Salesforce Suite
Version:
7.x-3.x-dev
Component:
salesforce.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2014 at 14:51 UTC
Updated:
21 Feb 2026 at 19:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ohthehugemanatee commentedComment #2
ohthehugemanatee commentedWhoops, missed an else{ :) Updated patch attached.
Comment #3
moss.dev commentedHi ohthehugemanatee,
Thanks for the patch. I have a few issues with it though.
Firstly, I could not get it to apply automatically using the normal methods with errors like:
fatal: corrupt patch at line 32
But I could not see any issue with it.
Secondly, after applying the patch by hand, it does not really do what it says on the tin.
You describe it as "force update from salesforce or from drupal" but all I get is a checkbox with the description "Ignore updated times and overwrite Drupal objects with values from Salesforce on every Pull."
After checking the checkbox nothing happens, no pull seems to be triggered.
What I was expecting was a button to trigger a pull and another button to trigger a push.
Can you please explain what this check box should achieve and how it could be of use.
Thanks,
PS. Does anyone know of a good method to trigger a pull?
Comment #4
ohthehugemanatee commentedAhh, makes sense. Sorry for the bungled explanation.
> Can you please explain what this check box should achieve and how it could be of use.
In a normal pull operation from Salesforce, it filters by SF's "last updated time" to make sure it's only getting updated objects from salesforce. When it's processing the queue of objects to update, it also checks the updated time of the Drupal entities, to make sure it's actually older than the SF object which will replace it.
If you hit the checkbox, both of these checks will be ignored. On any normal pull operation, your drupal objects will be overwritten. This is useful in case:
a) you've updated your mapping. I'm not 100% certain but I *think* it wouldn't otherwise consider that cause to update the Drupal object.
b) you just switched salesforce environments
c) you're adding sync with an existing SF installation to an existing Drupal site.
Maybe there are other cases as well.
If it's helpful, I used cron_debug module to let me trigger salesforce_pull separately from the rest of cron. I then used drush queue-run salesforce_pull to fire the queue.
Oh, and I also got "malformed patch" when I just tried to apply it. If you've just manually applied the patch, please re-roll!
Comment #5
tauno commentedThis is a handy feature, but it seems like this could be implemented more simply. It also needs re-testing against the current code.
Comment #6
Mile3 commentedPatch in #2 works in D7 7.38 and SalesForce 7.x-3.1 on my site.
This is very useful for getting a clean pull of all records after a change in the mappings, etc. I think the patch would be a very nice feature in the module.
Comment #7
pianomansam commentedPatch wasn't cleanly applying to latest dev, so here's a re-rolled version. In reply to tauno, perhaps there are better ways in implement this functionality, but the changes to the code are pretty simple and minimal as it is. I'm not convinced we need a different approach. But if you're interested in writing one, go for it!
Comment #8
aaronbaumanI had a similar thought recently, giving rise to #2559525: decompose functions in salesforce_pull to make more re-usable; pull a single record, expose to actions, etc.
If there were a "pull" action available for mapping_objects, you could accomplish this with VBO.
This would be much cleaner than going through the mapping CRUD interface.
(You could also expose a "pull" button on the %/salesforce_activity local action.)
A couple other considerations:
- adding a "force" property on SF pull queue items, which forces updates even if Drupal entity was changed more recently
- pulling records which don't have an existing mapping_object
Comment #9
pianomansam commented@aaronbauman, I agree that type of functionality would be *very* useful.
Comment #10
aaronbaumanHere's what I've got so far.
This patch adds a "push" button to the existing salesforce-activity form
Still todo:
- Right now salesforce_push_entity_crud() is not granular enough. Needs to be broken down a bit further to allow mapping objects to be pushed immediately, even if the mappings are set to use "async". So, if you have an async mapping, you'll notice that "push" just enqueues the record to be pushed on cron.
- Add a "pull" button
- Allow to push/pull by mapping (e.g. checkboxes for each applicable mapping), instead of trying to push all mappings related to a given Drupal entity type.
Comment #12
aaronbaumanpatch from #10 is committed.
updating status back to active, re TODO items in #10 and updating summary and title.
Comment #13
aaronbaumanComment #14
chrisolofJust ran into a situation where I needed to re-pull everything fresh from SF for a mapping (the mapping changed). I'd imagine this is a pretty common scenario so I'd be interested to here what others are doing to make this happen once things are live and you can't just wipe the entities down and truly start fresh (as you could in, say, a dev environment).
Right now I'm zeroing out the last pull variable for the SF object type and then changing the relevant mapping objects' entity_updated property to zero. Pretty cumbersome and makes the sync history a little inaccurate - but it works. I should note I'm running in asynchronous (cron) mode.
If this new functionality was exposed on the admin/structure/salesforce/mappings form that would be nice because you could check off all or some of the mappings and maybe select "Re-Pull" or "Re-Push" from a bulk actions select box below the mappings - potentially re-pulling or re-pushing everything under multiple mappings in a single operation.
A simpler approach may be to simply add "re-pull" and "re-push" action links to the right of each mapping.
Comment #15
nyl_auster commentedHello all !
Here is what i did in a custom module to create a new item menu forcing re-pull of datas :
Comment #16
antoniog4 commentedSince I needed the original behavior of #7, I redid the patch to include the force pull with a debug option.
Comment #18
rogerrogers commentedThe latest patch in this thread doesn't apply cleanly with the latest dev release of the 7.x module. This is a pretty basic and critical feature - would be good if it got included in the module. I've never learned how to create a Drupal patch and don't have the time at the moment, so here is a git commit that shows the diff:
Comment #19
aaronbauman7.x is no longer supported