• Resolved mcatalyst

    (@mcatalyst)


    Hello,

    We use this plugin together with Gravity Forms for user registration. Once user activates WordPress account, plugin helps create a new Salesforce Contact and associates it with their company. This works great for new WP users that don’t already exist in SF.

    One thing we can’t figure out is – when Contact already exists in Salesforce, but it doesn’t exist in WP. User creates a new WP account, but their Salesforce record is not being updated (we tested matching email address, first, last name, company name..), nor a duplicate created.
    We only use the sync one way, from WordPress to Salesforce and not the other way around because of other considerations.

    Is this plugin intended to update existing SF records? Any tips would be greatly appreciated. Thanks a lot in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    The plugin is generally able to look for a prematch if you have a field that should be identical, yes. For example, email address. What the plugin should do is create a new record in the wp_object_sync_sf_object_map table with the new user ID and the existing Contact ID. It might not be able to update the Salesforce record though, sometimes this can be skipped if it happens too quickly (this is how the plugin prevents infinite update loops).

    I think here’s what I’d advise:

    1. First, turn on the plugin’s debug mode. This will create a lot of log entries that you can watch to see if something is wrong.
    2. Then, check the wp_object_sync_sf_object_map table to see if it is, in fact, creating an object map between an existing Salesforce record and a new WordPress record.
    3. If it is not, check to see if you’re trying to prematch against a meta field in WordPress. This won’t work because the user gets created (and so it tries to match with Salesforce) before the meta field gets created. So the prematch field has to be a core wp_users field (for example, user_email). There are ways you can possibly kind of get around this with a developer hook. There’s some documentation about that here: https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-upsert.md
    4. If it is creating an object map, but it’s not updating the record, you could use a developer hook to push an update manually. I think you’d want to use this developer hook: https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/extending-before-and-after-saving.md#after-success-1, although I haven’t tried this. You could just have it run an update, I guess. We’ve done a maybe similar thing at MinnPost that you could read in this add-on plugin: https://github.com/MinnPost/minnpost-wordpress-salesforce-plugin/blob/master/minnpost-salesforce.php

    Thread Starter mcatalyst

    (@mcatalyst)

    Thank you so much Jonathan for pointing us in the right direction! We will be testing this and next week. I’ll post here what we find ??

    Thread Starter mcatalyst

    (@mcatalyst)

    Coming back to note for anyone having similar issues – very simple trick made this work and upsert/update existing Salesforce contacts – under Fieldmaps tab, make sure to check off ‘prematch’ for email address. That’s it! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Updating existing SF contacts with new WP users’ is closed to new replies.