• Resolved pavelwld

    (@pavelwld)


    I have about 35000 leads in SF and some of them have same salesforce ids with difference only in one letter case ( XYZ and XYz for example ). As a result they can not exist in website together ( [Err] 1062 – Duplicate entry ‘XYz’ for key ‘salesforce’ ). The problem was solved by setting salesforce_id column as “varchar(32) BINARY”. Dont you think it has to be updated in object_sync_sf_object_map table definition ?

    Another strange issue happened to me – the last fieldmap row is being deleted when i edit fieldmap and add new row, so i have to add duplicate for last row saved earlier to keep it not removed from list. As i see – the index of new added row when editing is the same as last row index in the list ( for example wordpress_field[19] dropdown is the last, but new added has also wordpress_field[19] name )

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

    (@jonathanstegall)

    @pavelwld you’re right about this unique issue. I will release a fix for this in a plugin update shortly.

    I’ve been trying to reproduce the second issue you mention. When I go to edit a fieldmap myself, the new index has an incremented value, as it should.

    What browser are you using when this happens? Does it only happen on large fieldmaps (as your example has 19 fields, I’m curious if that is relevant) or does it also happen on smaller ones?

    Thanks.

    Thread Starter pavelwld

    (@pavelwld)

    Hi again. Thinking the issue is here https://www.screencast.com/t/9ODsuvdq3o , in js. If I add for example 3 field mappings they have name indexes 0, 1, 2 . The next added would be equal to row_count = 3 – its OK. But after i remove first added mapping and try to add the new, the row_count is equal to 2, but my last mapping already has name index=2. I think you have to rebuild indexes when saving at server side to make them begin always from 0.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @pavelwld okay, thanks. I see what you mean now. Here’s my guess of what will work. This is rather complicated because the server won’t receive the array if there aren’t distinct values, but as you say deleting can mess that up.

    1. In the JavaScript, I propose using the current Unix timestamp value in place of the row_count value. This will keep it unique as it gets sent to the server.
    2. In the PHP, when the form is rendered post-save, I propose using an md5 of the array key combined with the current Unix timestamp value. This will keep the server from rendering the same time for all of the existing rows, but will allow the JavaScript to avoid any conflicts.

    I’ll release this as a plugin update in the near future, if you agree that this will work, or if I don’t hear anything from you.

    Thread Starter pavelwld

    (@pavelwld)

    I think it should work, Jonathan.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    I’m releasing a plugin fix to this effect, which seems to work nicely. I’ll mark this as resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘make unique salesforce_id column case sensitive’ is closed to new replies.