Well, a pull should successfully delete records in WordPress when they are deleted in Salesforce, if the delete trigger is checked on the fieldmap, but otherwise a deletion doesn’t do anything.
Also, please close your other issue if you have resolved it.
Sorry, maybe I wasn’t clear (or I’m not understanding what you’re saying), but I deleted the posts on the WordPress side, not the Salesforce side. Basically, I wanted to start with a new import, but the original Salesforce objects didn’t change. But having deleted the WordPress posts, it seems like Salesforce, having mapped to the ids with a key, doesn’t realize the WordPress posts don’t exist.
That’s correct. If you had the WordPress delete trigger checked, it would have deleted the items in Salesforce when you deleted them in WordPress (so that is a push event). Otherwise it doesn’t do anything upon a WordPress delete.
Right, but I’m not trying to do an actual sync to Salesforce, I just want to pull. So if Salesforce creates a post in WordPress, and then I delete that post, you’re saying the plugin won’t ever recreate that post when the object gets updated in Salesforce?
How do I reset the mapping/connection?
-
This reply was modified 8 years, 3 months ago by
amddtim.
Yes. Updating an item in Salesforce does not trigger a create in WordPress by default, since create and update are not the same action. However you could change that with a hook:
add_filter( 'object_sync_for_salesforce_pull_object_allowed', 'allow_pull', 10, 5 );
// can always reduce this number if all the arguments are not necessary
function allow_pull( $pull_allowed, $object_type, $object, $sf_sync_trigger, $salesforce_mapping ) {
if ( 'something' ) {
return true; // if this event is true, an item will be pulled into WordPress
}
}
You’d want to think a little carefully about what kind of conditional to use there, I think, but it would be doable.
I don’t really plan to delete the WordPress objects again in the future, so would there be a way, perhaps in the database, to delete all the ‘pull from Salesforce’ relationships? That filter might be heavy-handed for me in the long run.
You can do a list of all the rows with this: select * from wp_object_sync_sf_object_map; (assuming wp_ is your table prefix) and then you could delete the ones you don’t want. It saves the last action, pull or push, and it could be either, but you could possibly figure out what you need that way.
Great. Let me take a peek and let you know.
Okay, deleting those rows is what I needed. Thanks!