You need to sign in to do that
Don't have an account?
Caleb Kuester 35
The problem is the spaces. Any state that has a space fails validation.
I do not get a different result if I remove the \\s items and use TRIM(), or SUBSTITUTE(x, " ", "")
Has anybody else come across this?
Is there a way to validate state name for Custom Metadata Type DeveloperName field?
So Custom Metadata Type records must have the DeveloperName field populated by some kind of text. I don't want that field, but without a choice, I decided to use them in a way that is relevant to my case.
My records are for states, so I want my users to have the presence of mind to be able to spell them correctly, including case.
The only option I have is validation rule with regex.
Here is my rule:
NOT(REGEX(DeveloperName, "/Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Guam|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New\\sHampshire|New\\sJersey|New\\sMexico|New\\sYork|North\\sCarolina|North\\sDakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode\\sIsland|South\\sCarolina|South\\sDakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West\\sVirginia|Wisconsin|Wyoming|Washington\\sD.C./"))
The problem is the spaces. Any state that has a space fails validation.
I do not get a different result if I remove the \\s items and use TRIM(), or SUBSTITUTE(x, " ", "")
Has anybody else come across this?
Figured it out. It's:
-- if anybody's curiousI was also checking the wrong field before.