3

I have a "Dupe Detector" field in a couple of objects that is Unique (Case Insensitive). It is a Text(255) whose value is updated by a Workflow Field Update.

We have recently had the problem that different Ids can be identical when case insensitive, e.g. 003U000000p3nyu and 003U000000p3nyU.

Therefore we need to change this to case sensitive. But as it's a managed object, we can't.

Normally I would create a new field/workflow that is identical to the old one, but case sensitive. But then I have the problem of the old field being null and as it's unique, it would still fail.

The only solution I can think of is to put a formula like NOW() as the Default Value of the old case insensitive field, to guarantee uniqueness. But that seems like a big hack.

Is there a better way? Or has anyone had any luck contacting Salesforce to get a field changed from case insensitive to case sensitive? It wouldn't break any existing data...

  • better if you could release a patch. – Bforce Feb 28 '14 at 13:21
  • @baskaran How would that help? – George S. Feb 28 '14 at 13:55
  • 2
    Would the CASESAFEID() function help so that your ID values were 18 characters long and case insensitive? – Keith C Feb 28 '14 at 23:08
3

The sample ID's you are showing are the 12 character case sensitive versions. You will want to convert them to the 18 character case safe Id's.

E.g.
003U000000p3nyu becomes 003U000000p3nyuIAA and
003U000000p3nyU becomes 003U000000p3nyUIAQ.
Note that the last 3 characters are purely to distinguish the casing. See more in What are Salesforce ID's composed of?

Since you are doing a workflow field update then, as @keith-c suggests, you can use CASESAFEID(id) to do this conversion for you.

If by chance you were working in Apex that you can do the conversion there as well: CASESAFEID() apex equivalent.

Don't forget to trigger the workflow rule again once updated for any existing records so the value gets updated.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.