Support » Plugin: Object Sync for Salesforce » User Role mapping

  • Resolved esowers

    (@esowers)


    We’d love to map user roles to Salesforce. I’m able to push data from WP to SF However whenever its mapped and there is a change in salesforce it comes back to WordPress’s database as an unserialized value (when WordPress normally stores that info as a serialized array). Is there a way to map these successfully, or could that option be added to a roadmap?

    Thanks!

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

    (@jonathanstegall)

    Currently the plugin does check to see if it’s trying to save data into the wp_capabilities field, and if it is, it tries to make an array that WordPress will then serialize.

    Are you indicating that this doesn’t work in your situation, or that you need it to do something in addition to this?

    Thread Starter esowers

    (@esowers)

    Hmm, that doesn’t seem to be working correctly for me then. I’m syncing to a TEXT field in Salesforce. I then remove a permission value (along with the preceding semicolon) and then I go to the user’s record in WordPress and do a manual “pull from Salesforce”. The value that gets pulled back to the wp database is the text value.

    Does my Salesforce field need to be a picklist(multiselect) instead?

    I am trying to map to the wp_capabilities field.

    • This reply was modified 1 month, 1 week ago by esowers.
    Thread Starter esowers

    (@esowers)

    Oh, I just realized. I am using User Role Editor plugin to manage permissions and assign multiple user roles. Could that be the issue?

    Plugin Contributor Jonathan Stegall

    (@jonathanstegall)

    I think it does need to be a picklist in Salesforce, yes. The plugin does check for that first. It makes the assumption that roles would go to a picklist. Then I think it will work with the User Role Editor.

    You could also use a developer hook to make it work with a non picklist field.

    Thread Starter esowers

    (@esowers)

    Awesome! Got it working. I think the plugin was caching the field type of TEXT from salesforce so when I changed the field type it wasn’t pulling over the correct values. I deleted the mapping and re-mapped it and now it’s serializing the values correctly from the multi-select list in Salesforce.

    Thanks for your help!

    Plugin Contributor Jonathan Stegall

    (@jonathanstegall)

    Great! I’m not necessarily opposed to letting it map roles to non-picklist fields, but it feels like it would require a lot of thought to make sure it doesn’t mess up other things. For now I think we’ll keep it as it is, although it does flag some documentation needs I don’t think I’ve articulated before.

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