• Resolved ilana Bittner

    (@ilanabit)


    Hi Jonathan!

    Is there any special voodoo that needs to happen to sync Picklists? I have all text fields syncing beautifully, but picklists are not playing as nicely in my sandbox. One example, I have a dropdown field in Both SF and WP called “Retired?” with choices of “Yes” and “No”. I get the following error:

    Error: 400: on Salesforce http request
    URL: https://na74.salesforce.com/services/data/v41.0/sobjects/Contact/0031J00001InRZ4QAN
    Message: Retired (Y/N): bad value for restricted picklist field: 1
    Code: 400

    Another example, I have a “Salutation” dropdown in WP with a list of choices (Mr, Mrs, Dr, etc) that matches the same field in SF. It doesn’t generate any errors when syncing from WP to SF, but when I look at the Contact in SF, there is a number in the Salutation field that matches the item I’ve chosen on the WP side rather than the actual value selected. For example, if I choose Dr, which is the 3rd item on the dropdown, the number 3 appears in SF rather than Dr. If I change it in SF and sync to WP, no error is recorded but the value doesn’t update in WP at all.

    Thanks for any suggestions!

    Warmly,
    ilana

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

    (@jonathanstegall)

    @ilanabit hi Ilana. You’re quite right, the plugin seems to have been failing on picklists. I have released an update today (version 1.2.0) that, in our testing at least, fixes this issue both for regular picklists and also multi-picklists, among other fields.

    I believe this will fix the examples you mention if you install the update, but do update here if it does not.

    Thanks,
    Jonathan

    Thread Starter ilana Bittner

    (@ilanabit)

    Thanks, Jonathan!

    I’m still having some trouble. When pulling from SF, I get a 400 Error:

    URL: https://na74.salesforce.com/services/data/v41.0/query?q=SELECT+F%2C+%2C+M%2C+L%2C+S%2C+P%2C+O%2C+H%2C+n%2C+B%2C+V%2C+G%2C+E%2C+Id%2C+LastModifiedDate+FROM+Contact+WHERE+LastModifiedDate+%3E+2017-12-19T02%3A01%3A57Z+ORDER+BY+LastModifiedDate+ASC

    Message:
    SELECT F, , M, L, S, P, O, H, n, B, V, G
    ^
    ERROR at Row:1:Column:10
    unexpected token: ‘,’

    Code: 400

    When pushing to SF, I get different 400 Error:

    URL: https://na74.salesforce.com/services/data/v41.0/sobjects/Contact/0031J00001IpjiiQAB

    Message: No such column ” on sobject of type Contact

    Code: 400

    Also worth noting that I can’t seem to edit my fieldmap anymore. I tried to delete the two fields that have pick lists, to see if I still get the 400 errors, and when it tries to save, the red vertical line that denotes an error appears at the top of the screen, but with no error message.

    • This reply was modified 7 years, 3 months ago by ilana Bittner.
    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @ilanabit I think I’ve fixed the pull issue you mention with a 1.2.1 update. I think this will allow you to edit your fieldmap as well, but I’ve been unable to reproduce that error, so I’m not sure. If you are unable to pull or update your fieldmaps after installing 1.2.1, I’d be interested if the plugin log messages are different, and also what is in the PHP error logs.

    I’m also not sure about the 400 error. I believe you mentioned something similar to this in this issue? I am not positive, but that could be a permissions issue on the Salesforce side. The authenticated Salesforce user that WordPress is using may not be able to access one or more fields in Salesforce. I would check into all the field’s permissions in Salesforce.

    Thread Starter ilana Bittner

    (@ilanabit)

    @jonathanstegall Even after the second update, I was unable to edit the fieldmap. I ended up backing up, deleting it and starting over. Now its fine and I can edit the new field map, so it must have been some kind of ghost.

    As for the 400 error, it is a different error after the update, which is:

    Its a Yes/No data field with the same choices as SF, so I started looking at the raw data in SQL and discovered that the plugin I’m using to create additional User fields is saving them to the database as a numeric value rather than the text in the picklist. I think I’ll just need to find a different plugin for that. I know you built this to sync User data, are you adding any additional data fields or just using the standard WP ones?

    • This reply was modified 7 years, 3 months ago by ilana Bittner.
    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @ilanabit I’ve seen that restricted value error in a different platform we integrate with Salesforce. We never use restricted values because they don’t seem to make any sense, even when the values are text in both places. I hope this is something we could address in this plugin, but I’ve never been able to find a good solution.

    Salesforce provides these reasons for the error, which makes me think that perhaps one of the other reasons is the culprit.

    In any case, we are using additional data fields on users, categories, posts, etc. – we currently use the CMB2 plugin. But this does not, regardless of how the text is stored, seem to affect restricted picklists.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @ilanabit I have found the solution for restricted picklist values, at least in our Salesforce install. Here’s what I did:

    1. Go to Setup
    2. Customize -> Opportunities (I am testing with an opportunity picklist at the moment; presumably we’ll need to do this for all record types with restricted picklists)
    3. Click Record Types under Opportunities
    4. Click the name of the desired record type (for me it was Default, but I’ll also need to apply it to some other opportunity types). Clicking Edit didn’t work for this; only clicking the name. So the URL ends up being like this: /setup/ui/recordtypefields.jsp?id=012F00000013Gkq&type=Opportunity&setupid=OpportunityRecords
    5. Scroll down to the desired picklist and click Edit
    6. Move the values from Available Values to Selected Values (I didn’t pick a default because we don’t have a default for this picklist) and Save

    After I did these things, I was able to send values from WordPress and our Python app to the restricted picklist without errors.

    Hopefully this could be a possible fix for you as well.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Going to go ahead and mark this issue as solved. I think there is still an enhancement we could provide, either in documentation and/or in the fieldmap interface, to tell users that they need to check the settings for their restricted picklist values (because we can’t tell the settings by the API response, but it could cause errors if they don’t have the right settings in Salesforce). There’s a comment to this effect here, in GitHub: https://github.com/MinnPost/object-sync-for-salesforce/issues/128#issuecomment-354773055

    But I think as far as this issue goes, where the plugin was not behaving as it should prior to 1.2.1, we should be good unless this issue is reopened.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Syncing Picklists’ is closed to new replies.