Are you saying that the ID from Salesforce is what gets stored in WordPress and not the actual value of the field?
If so, can you describe what your fieldmap looks like? That is, which Salesforce fields are being mapped to which WordPress fields?
Correct. To get around this issue I created a select field with the value (Salesforce ID) : label.
I’m not sure how best to describe this, so here is a link to a few screenshots.
Okay, I think I maybe understand. My guess is that the Account field represents a related object in Salesforce. A parent object or whatever they call it. When you load a related object via the API, it does always return the ID of that record.
For example, when I have a Contact in Salesforce, it’s always associated with an Account. And if I got to the page for the contact, I can see the name. But if I try to load or modify the contact’s data via the API, the account is always represented by the ID, not the name.
Does that make sense?
There are ways to use the API to get the account name from the ID. That’s not a thing I would build directly into the plugin, but you could do it with developer hooks. But if you’ve already got it working with ACF (I’m assuming that’s an ACF screenshot) that’s maybe just as good.
Oh, also, one thing we sometimes do is create a field on the contact object that loads the value of whatever field from the related account. So for example, if we want to see the membership level from the account record on the contact object, we’d create a contact field called membership level, give it a type of Formula, and then the formula value is Account.Membership_level__c.
You could do the same thing with Account.Name (or whatever the name is called) and map that to a separate field.
I don’t know if this is a best practice in Salesforce, there might be other ways to do this, but this is how the folks who manage Salesforce handle it at MinnPost.
Thanks for the insight Jonathan!
Ok, great. Going to mark this as resolved for now, then.