Support » Plugin: Object Sync for Salesforce » can import all the user from salesforce to wordpress

  • Resolved silasip


    HI all,
    I would like to import all the existing members of the salesforce into WordPress.
    Is the plugin can do it?
    If not, is there any other plugin that can do it?
    Thank you,

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Jonathan Stegall


    This plugin wasn’t built to bring in existing records that were created before it was installed. Because of that, it doesn’t do bulk imports well unless you’re comfortable writing JSON code. Here’s one way you could try to do it (I would recommend not doing this in a production environment first):

    1. Set up the plugin and make sure that an import of at least one new member from Salesforce into WordPress works.
    2. Do an export from the plugin of the object map so you can see how the JSON structure works.
    3. See if you can expand that JSON structure to include all of the existing members with their data.
    4. Do an import of the expanded JSON into the plugin.

    If all of those steps worked, you’d be able to update the records in Salesforce and have the changes come into WordPress.

    To be clear this is a lot of work, and it might not work with your WordPress data structure depending on what plugins you use for member data. But that’s the only way to do it, currently.

    I’ve been able to import all existing data from any SalesForce objects by using System Modstamp as the date field to trigger pulls, then running a very simple anonymous APEX statement that updates all of the timestamps on the object in SalesForce. Basically, the plugin is watching for updates to SalesForce records so you just need to make them all appear to have been updated, even if nothing really changed other than the date that Salesforce thinks the record was last updated. Of course, you’ll want to be sure that updating the Modstamp won’t cause issues in your org (if it’s being used for some business reason), but I don’t think it’s likely that it would.

    Here is APEX code that will update all of the System Modstamps in a custom object called objectList (objectList__c):

    List<customobject__c> objectList = [select id from customobject__c];
    update objectList;

    You can use the Salesforce Developer console to execute this, or I like to use a tool (no affiliation with) called FustIT SFDX Explorer that makes it a little easier for me to do this than the Developer Console.

    • This reply was modified 2 months, 2 weeks ago by imtom.
    Plugin Contributor Jonathan Stegall


    @imtom thank you for adding this. I’d like to figure out where to put this, or where to link to it, in the documentation so it’s easier for folks to find. I don’t think I’d build this into the plugin, but it would be nice to have it available as an answer.

    Plugin Contributor Jonathan Stegall


    Now that I think about it, I’ll update the import/export documentation to add this. I’ll link to this question and credit you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.