• Resolved sevenlayermedia

    (@sevenlayermedia)


    This plugin has worked really well, thank you!

    I’m using Object Sync for Salesforce with ACF fields – When a Salesforce user adds a new option in Salesforce the synced field syncs, however, it returns the ID and not the associated label. My initial workaround was to map the ID with the label in an ACF select field. This works well, until a new option is added into Salesforce. Am I mapping the fields incorrectly? I reached out to Salesforce, but the recommended reaching out to the plugins’ developer. Thanks for your time.

    The page I need help with: [log in to see the link]

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

    (@jonathanstegall)

    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?

    Thread Starter sevenlayermedia

    (@sevenlayermedia)

    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.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    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.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    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.

    Thread Starter sevenlayermedia

    (@sevenlayermedia)

    Thanks for the insight Jonathan!

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Ok, great. Going to mark this as resolved for now, then.

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

The topic ‘Salesforce Fields Returning ID vs Label’ is closed to new replies.