2

One of our integrations attempted to insert a Contact record with a value for LastName = ????? (yes - five question marks).

SFDC failed the insert (before any trigger executed) with:

FIELD_INTEGRITY_EXCEPTION, Last Name: You must enter a valid value: [LastName]

I duplicated the error by entering a Contact into the UI with LastName = ?????

LastNames of ?, ??, ???, ????, ?????? and ??????? pass, only LastNames with five question marks fail

1 Answer 1

5

Inspired by that classic (and highly relevant) 60's garage rock song 96 Tears by ? and the Mysterians, here is how I figured it out:

  • I went to a Dev Edition I had laying around and tried entering a Contact with Lastname = ?????. This passed, no problem
  • So, what was different between a Dev Edition and our Prod/sandbox world? (remember, the error occurs before any triggers or before save flows execute). Per the Triggers and Order of Execution, the error occurs at Step 2

And .... the difference was that in our PROD/sandbox world ....

  • Contact.Name has Shield Platform Encryption enabled (Deterministic - Case Insensitive)

enter image description here

  • I went back to the Dev Edition, enabled encryption on this field and reproduced the issue.

As an experiment, I did some other variations with a value of ?????:

Field Encryption type Result
Account.Name Deterministic - Case Insensitive Fails
Account.Name Deterministic - Case Sensitive Fails
Contact.Name Probabilistic Fails

Assuming you need encryption on Contact.Lastname (and probably, any text field) and you get inputs of five question marks, there is no workaround. 96 Tears indeed.

3
  • This is a nice find.
    – manjit5190
    Commented Jun 4, 2021 at 18:26
  • 2
    Gosh... I love going down the rabbit hole, but this is pretty deep! Commented Jun 4, 2021 at 18:35
  • That's an impressive find. Nicely done! Commented Jun 7, 2021 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .