Date field to trigger pull
-
Hi,
I am pushing the WP data to SFDC. I have read much of the fieldmap documentation on GitHub and I do not see any documentation on the date available to set for the trigger. I am not familiar with some of the options. Could you point me to the definitions of these fields? I do not know if they are WP fields or SFDC fields. Some look like SFDC fields so do they work if I am pushing from WP to SFDC? Options are
Created date —– obvious
Last Modified date — I assume this is for the object selected
System Modstamp
Last Stay-in-Touch Request date
Last Stay-in-Touch Save date
Last viewed date
Last referenced date
Email bounced date
Thanks
-
Yes, please refer to https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/mapping.md#more-on-salesforce-object for more about the Salesforce object when creating a fieldmap. You’ll see that for some Salesforce objects, there is a date field that Salesforce returns.
“The date fields to trigger a pull request are how the plugin finds Salesforce records in mapped objects that have been updated since the last wp_cron run. For example, if you map WordPress users to Salesforce Contacts, this date field will allow the plugin to get all Contacts that have been updated since that last run.”
So if there is more than one date field, pick the one that works for your data needs.
Well, I’ve read the documentation several times and don’t see this addressed.
On the WordPress side. We uses several plug-ins that create extensions of the the user object. I am using these data fields with a last modified date. It appears that the last modified date is not being updated unless vanilla WordPress user fields are modified and not the plug-in extensions, so I get no updates. I have tried system-modstamp and last viewed date.
For example, I use several memberpress fields for the address. The only time an address change is updated is if the user fields (last name, first name and email) are updated. If I always update email address then it seems like the last modified date is updated and so are all the fields.
Any suggestions?
Let me see if I understand what we’re discussing. The fields we’re discussing are the same ones from above, right?
- Created date —– obvious
- Last Modified date
- System Modstamp
- Last Stay-in-Touch Request date
- Last Stay-in-Touch Save date
- Last viewed date
- Last referenced date
- Email bounced date
If so, all of these fields are from Salesforce. They only change when the Salesforce object is modified. So if you sync a WordPress user to a Salesforce contact, whenever the WordPress user sends data to Salesforce and it saves successfully, the Last Modified date changes. The Created date never changes. The Last viewed date changes based on activity in Salesforce. And so on.
This plugin uses these date fields for the pull query that runs on the Salesforce API to find out if there is new data in Salesforce that needs to be brought into WordPress. That is, if you choose the Last Modified date, the plugin will try to find matching contacts in Salesforce that have been modified since the last time the plugin’s cron job ran.
If that this is the understanding you already have, I think you’re saying that you’re trying to update WordPress address fields, which are custom fields from memberpress, but they’re not changing the Salesforce Last Modified date unless the core user fields (email, first, last) are also changed.
For comparison, I have a fieldmap with CMB2 (a custom field plugin) where I add street, city, state, zip to the user. If I map all of these fields, but only modify the address fields and not the city/state/zip, it sends the modified fields to Salesforce and it changes the last modified date in Salesforce.
Are you saying that with memberpress, you are unable to do this?
I only want to send data from WordPress to Salesforce. I do not want a sync or a SF to WP direction. I’m having a bit of trouble understanding this from the SF side.
Create: I do a create on WP and match on email address within SF. If match, I want it to update, if no match, to create a record. I have a fieldmap that is on create date. So what I think you are saying is that, SF pulls the data from WP. So if the record is not yet in SF, how does SF know to pull the data? I know it does because I have tested this.
Case II: I do an update on my learning management system or a profile update in WP and want to update the information in SF. The address fields are in WP not in SF. With the dates in SF, how does SF know to pull data from WP?
Okay. In this plugin, “push” is when data goes from WordPress to Salesforce; “pull” is when data comes from Salesforce into WordPress. Salesforce never pulls data from WordPress on its own with this plugin.
So for your purpose, this date field dropdown is not relevant. It will have no effect on what you’re looking to do.
If you create a fieldmap where the checked triggers are WordPress create and WordPress update, that will push data from WordPress to Salesforce, as you say. If you check “process asynchronously” it will push data at scheduled intervals, based on the Scheduling tab’s settings.
If you have the WordPress address fields mapped to the fields in Salesforce, WordPress will push the data to Salesforce and save it there. But are you saying that it only does this if you also change the user’s email/first name/last name?
It makes sense to me now. Once you explained the concept several messages ago, the date field dropdown didn’t seem relevant.
Let me try the process asynchronously to see if anything changes and yes, I am saying that the address fields and other WP plug-in values only update when I change the user’s email/first name/last name.
Didn’t make a difference. I assume wp-cron is running although I have no idea how to check.
This sounds to me like something specific to memberpress. I’m not familiar with it, and it doesn’t appear to have a way to install a free trial. It’s possible they are doing something that isn’t standard to WordPress with their data model.
It’s possible we have a developer hook that could be helpful for you (they’re all listed at https://github.com/MinnPost/object-sync-for-salesforce/blob/master/docs/all-developer-hooks.md), or perhaps memberpress has its own developer hooks, but other than that the only thing I can think of is that you might possibly use hidden form fields to ensure that the core WordPress fields get passed along with the plugin fields.
wp-cron is running. My assumption is that this is cron on the WordPress system. The IT guy said it is running. I do not get any asynchronous transactions to process. They just sit in queue. I had the 2 I created yesterday sitting in queue today when I started work.
This is what I know so far.
1. on an update — the only way I can get the data to pass is through modification of the email address. I did more testing today and first name and last name do not trigger the update either. None of the other fields seem to trigger an update.
2. If I do modify the email address, all fields update correctly and it does exactly as I want.
3. If I just retype an email address, it does not triggerAny idea besides developer hooks?
Anyone???
Can you do a test with non-memberpress data and see if it works differently? I’d like to see whether this is an issue specific to how the two plugins interact.
For example, if you have a default user profile inside the WordPress admin, and map those fields to Salesforce, or use a custom field plugin like CMB2, does it work differently? If it still has the same problem, it’s possible there is a host issue.
Related to that, do you have access to the server logs on Apache (or wherever the site is running)? Do they say anything?
Hi,
Sorry that it has taken me so long to get back to this. I am trying to test with non-memberpress data. That is a bit tricky though since most of what I am updating is the memberpress data. I also have woocomerace but we don’t really use it.My guess after pondering on this is that whatever field you are using to determine that the update is happening is “probably not being updated when the memberpress data is being changed”. Can you tell me what field that is and I’ll ask Memberpress support?
This plugin uses WordPress hooks to determine when data is updated, not a field. These are the hooks it relies on.
For users:
– user_register
– profile_update
– delete_userFor posts and custom post types:
– save_postFor Attachments:
– add_attachment
– edit_attachment
– delete_attachmentFor tags/categories:
– create_term
– edit_terms
– delete_termFor comments:
– comment_post
– edit_comment
– delete_commentThese are all built into WordPress, so they’re documented in WordPress docs.
I think it’s possible that memberpress doesn’t save the user object when it updates, but only saves a user meta field. If that’s the case, you could pass a core user field so that it will cause one of those hooks to run. Otherwise, you could use a developer hook in this plugin.
I think you are right about the usermneta fields. I have read memberpress and WordPress support documentation and it does not say that but it seems like that is what is going on.
I have always tried to pass a core user field (email). If I update the email field, I get an update in SFDC. If I don’t update the email field or if I update it retyping the same value, I get no update.
I have also looked at your other hooks and do not see one that would help me in this situation, but honestly, I don’t really know how to use it if there is one.
I thought maybe I could set up a different update using a memberpress object, but the address values only appear on the WP “user” object.
I am out of ideas. Sigh!
I’m surprised it behaves this way. I’ve tested this plugin often with, say, custom user profile pages that only update custom usermeta fields, and they always pass the data to Salesforce as they should. This is because it fires the profile_update hook.
It does seem like memberpress is doing something different that causes this hook not to run, but I’m certainly not sure what hooks it does run.
It’s a hack, but maybe you could add a standard, hidden usermeta field outside memberpress that just passes an automatic value, like a timestamp or something, to make sure profile_update runs.
The topic ‘Date field to trigger pull’ is closed to new replies.