Sync from Salesforce to WordPress
-
Hello Again,
I set up a couple of field maps.
Wordpress field: Post
Salesforce field: AccountWordpress field: User
Salesforce field: ContactI mapped Post Title to Account Partner Name and User to Contact Full Name with ‘sync’ checked. I did not check either of the other 2 boxes.
The mapping works from WordPress to Salesforce, but not the other way around. When I create a new user in WP, it creates a contact in SF. When I write a post in WP, it creates a new account in SF.
However, when I create new contacts or accounts in Salesforce, they do not appear in WP. Is there a setting or permission in Salesforce that I need to adjust?
The page I need help with: [log in to see the link]
-
Hi,
A few questions:
1. Which action triggers do you have checked on the fieldmap?
2. Did the plugin create any log entries? (if you have logging enabled, logs get created as their own custom post type – Logs)
3. What are your schedule settings? Have you verified that cron jobs are running as they should? (I recommend using the https://www.ads-software.com/plugins/wp-crontrol/ if you ever need to debug cron jobs).Hey Jonathan,
1. I have all 6 triggers checked.
2. I have logging enabled, but I do not see any logs in my posts.
3. I have the schedule set to every 1 minute for pull and push, I did not set anything for salesforce authorization.Also, I checked ‘sync’ on my field mapping, so it should be real-time, no?
I installed crontrol and these are the readings
_1 0 (now) Every 1 _0 0 (now) Every 0 minutes_1 60 (1 minute) Every 1 minutes as3cf_update_meta_error_interval 120 (2 minutes) Every 2 Minutes as3cf_update_meta_with_region_interval 120 (2 minutes) Every 2 Minutes as3cf_update_file_sizes_interval 120 (2 minutes) Every 2 Minutes as3cf_update_replace_s3_urls_interval 120 (2 minutes) Every 2 Minutes as3cf_update_replace_edd_urls_interval 120 (2 minutes) Every 2 Minutes as3cf_update_filter_post_excerpt_interval 120 (2 minutes) Every 2 Minutes wp_wc_updater_cron_interval 300 (5 minutes) Every 5 Minutes wp_gf_feed_processor_cron_interval 300 (5 minutes) Every 5 Minutes wpos3_remove_local_files_cron_interval 300 (5 minutes) Every 5 Minutes wpos3_copy_buckets_cron_interval 300 (5 minutes) Every 5 Minutes hourly 3600 (1 hour) Once Hourly twicedaily 43200 (12 hours0) Twice Daily daily 86400 (1 day) Once Daily weekly 604800 (1 week) Once Weekly monthly 2635200 (1 month) Monthly
-
This reply was modified 7 years, 4 months ago by
basquith16.
-
This reply was modified 7 years, 4 months ago by
basquith16.
No, sync is not about whether it is realtime. Sync just tells the plugin that you’d like data to stay in sync between the two systems, rather than just sending the data to one system or the other.
If you look below the triggers, there’s a checkbox about whether the plugin should process asynchronously. If you do not check it, the plugin will “push” in realtime. That is, when you create something in WordPress it will instantly go to Salesforce. But “pull” is never realtime because Salesforce is not making direct calls to WordPress. With pull, it runs on the schedule settings, which are based on cron.
Since push is working for you, and presumably is happening in realtime, I would find out whether the cron jobs are running successfully. I’ve heard of web hosts where there can be issues with this, although I’ve never had one myself. Try installing https://www.ads-software.com/plugins/wp-crontrol/ (it creates a menu under Tools where you can see the active cron jobs, when they run, etc). It does not create any logs, but it does give you a glimpse of when the jobs run.
For this Salesforce plugin, the logs are not added to standard posts – they are added as a custom content type with their own menu item. For example, in my installation the menu items sequence like this: Posts, Media, Pages, Comments, Logs, Appearance, Plugins, Users, etc.
I think it’s likely that whatever issue you have is either cron related, and/or that it will hopefully show up in your logs. If it does not, there isn’t a whole lot more I can offer without being able to duplicate the issue.
Oh, something else occurred to me. The cron job setup happens when the plugin is activated. I know your installation had trouble creating the database tables for some reason. I wonder if, because it presumably failed in the middle of activation, it never tried to create the cron jobs, and thus they aren’t running.
If that is the case, this becomes hard to solve without discovering what is keeping your server from creating database tables though, because plugin deactivation removes the tables. I am not a server admin by any means, so I have very little to offer about why a database table creation would fail.
(This might have nothing to do with cron – I don’t know for sure that it is at all relevant).
-
This reply was modified 7 years, 4 months ago by
Jonathan Stegall. Reason: clarify
Thanks for the reply. I had installed the crontrol plugin as you mentioned before and posted the results, but it says that the post is under moderation.
I did just see the logs on the menu, thanks! There is a 400 error and a few 404 errors.
Error: 400: on Salesforce http request – id value of incorrect type:
Error: 404: on Salesforce http request – entity is deleted
Error: 404: on Salesforce http request – Provided external ID field does not exist or is not accessibleI see the cron results now. It never said anything about moderation. Try this url in your WordPress: /wp-admin/tools.php?page=crontrol_admin_manage_page
That should tell you if the plugin is running its jobs or not. There should at least be a
salesforce_pull
row in the table. Maybe also asalesforce_push
but probably not if you haven’t used it.However the error logs you post there suggest that the pull is running as it is supposed to, but is getting API errors. 400 and 404 are Salesforce API error codes, and those are the messages that Salesforce is returning to the plugin. Salesforce provides a bit of info about their error messages at https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm, but it is only sometimes useful.
Same issue here, but can’t seem to get it work. I have installed de wp control plugin and I’m able to run the cron job.
Wordpress -> Salesforce goes fine
Salesforce -> WordPress seems to do nothing.Hope someone can help out.
@fcjoos hello, please try the suggestions in the thread above. Do you have any log entries that show errors? What are your log and schedule settings specifically for this
plugin? What fieldmap(s) have you created for this plugin?When you say WordPrewss -> Salesforce goes fine, are you doing it asynchronously or in realtime?
-
This reply was modified 7 years, 4 months ago by
Jonathan Stegall. Reason: make sure to ask about log/schedule settings
Hi Jonathan, thanks for your reply.
Wordpress 2 Salesforce is indeed realtime. You told earlier that Salesforce 2 WordPress is alway asynchronously. Schedule settings are: Pull from Salesforce is every 5 minutes.
When I look at the cron events under extra I see the following entry:
Hookname Arguments Actions
salesforce_pull None Object_Sync_Sf_Schedule->maybe_handle()
Object_Sync_Sf_Schedule->maybe_handle()
Object_Sync_Sf_Schedule->maybe_handle()I have enabled logging on error and notice, but no entries found in de log posts.
Thanks. A couple more questions:
1. What are the triggers to log values for the plugin log settings?
2. Are you looking in the custom content type for logs?
3. Try enabling the logging for success as well, and make sure that the plugin does create a log post when you send something from WordPress -> Salesforce. This will make sure your installation is able to successfully create log entries of any kind.
4. What settings are you using on the fieldmap itself (what fields are you using, are they all set to “sync” value, what are the trigger settings for the fieldmap, etc.)?After that, if you have logs for the successful WordPress -> Salesforce links, try creating some content in Salesforce and see if it creates any logs. If it isn’t already clear, the plugin will not load data from Salesforce that existed before it was installed; it will only gather info going forward.
Sorry for my late respons Jonathan.
The issue was solved. Probably because I had two different field mappings in the backend. Within WordPress in two different objects, but in Salesforce on one and the same object. Perhaps it also had to do with the fact that the pull was initiated via last viewed. I changed this setting to last updated.
Working like a charm now. Thanks for your help. Much appreciated!
@fcjoos thanks for the update. I’ll mark this as resolved, although I think there’s room for us here to think about what kind of documentation edits might be helpful.
Hi Jonathan,
I have another issue after moving the site to another domain. When trying to activate the plugin the followin error is thrown:
Parse error: syntax error, unexpected ‘[‘ in …../public_html/wp-content/plugins/object-sync-for-salesforce/classes/salesforce.php on line 142I tried to uninstall an install the plugin, but without any luck. I also updated the plugin to most recent version.
Can u please help me out?
Thanks in advance.
-
This reply was modified 7 years, 3 months ago by
fcjoos.
@fcjoos yes, this is because this plugin will not work on PhP versions lower than 5.5.
-
This reply was modified 7 years, 4 months ago by
- The topic ‘Sync from Salesforce to WordPress’ is closed to new replies.