• Resolved chercka

    (@chercka)


    Hey guys, first off this plugin is incredible. It solves so many of our problems, thank you. It’s also a huge win that it gives us access to calling the SF API directly through code. Very cool!

    I’ve been trying to read up on other support requests regarding how the sync works but am still unsure, sorry.

    Our situation: I have a large amount of custom objects in SF that I’d like WordPress to know about creation of/updates to. To this end I’ve manually exported the thousands of objects from SF and into a Custom Post Type in WordPress.
    Then I’ve setup two fieldmaps in the plugin with different ‘Date field to trigger pull’ settings: One is ‘last modified’ and the other is ‘date created’.

    I was thinking this would both update existing WordPress posts when an object is modified in SF and create new posts when new objects are created in SF.

    However I am seeing strange results and thinking that I’m missing some fundamentals around the capabilities of the plugin. Would love some background, thanks!

    Thanks!

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

    (@jonathanstegall)

    Sure, I can try to explain. Here’s how the plugin works:

    1. You create fieldmaps between an object type in WordPress and an object type in Salesforce. It sounds like you’ve already done this.
    2. But also, you have to create object maps between the individual objects. The plugin does not automatically map records to each other. So if there are existing records that were created before the plugin, which is what it sounds like you have, the plugin won’t be able to sync data between them. It would only do that for newly created records, if your fieldmap settings are tracking newly created records (the checkboxes at the bottom).
    3. However, you could try to import object maps if you can generate the right JSON. There’s some documentation about that here.

    This isn’t something I can provide further support for, because the plugin wasn’t built to backfill data, but here’s what I would try:

    1. Create an object map via the plugin. So, make a new record in WP or SF and get it synced. There’s a lot of documentation about this in the docs folder, as well as possible problems, etc.
    2. Export the object map from the plugin so you can see what the JSON syntax looks like. You could also look at the structure for the wp_object_sync_sf_object_map table if you have access to your database.
    3. Try to generate matching JSON or SQL for the records you’ve imported into WordPress. You’d need to know, at minimum, the WordPress ID, the Salesforce ID, and the WordPress object type’s name.

    You should be able to track new changes to the previously existing records if you’re able to import them this way.

    Thread Starter chercka

    (@chercka)

    Jonathan thank you for that massive and detailed response. That makes a lot of sense.

    I’m going to attempt building a script that generates the json for my manually imported objects and then import that into the plugin. I’ll post my results here for future reference.

    Can you clarify the ‘date field to trigger pull’ setting? I’m unclear about what to set that to when I want both newly created SF objects and newly updated objects to be sync’ed.

    • This reply was modified 6 years, 3 months ago by chercka.
    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I missed your reply here. Generally it’s fine to use LastModifiedDate as the date field to trigger a pull, at least in most cases. Salesforce will use that for newly created records.

    I expect that will also work for your manually imported records, as long as you can force them to update so the plugin sees them as having been updated.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Clarifying sync to WordPress capabilities’ is closed to new replies.