I have validation rule that does not validate as true, and I can’t see why is does not. The formula is as follows:
AND(
$RecordType.Name = "GSM Yfirsýn",
INCLUDES( mplGSM_Yfirlit_Extras__c , "Netið"),
REGEX(LEFT( txPayerKennitala__c ,1), "[4-6] {1}")
)
It looks for the specific Record Type, checks to see whether any selected values from the multi-select picklist mplGSM_Yfirlit_Extras_c contain the word ‘Netið’ and also does a regex check on whether the first letter of the text string contained in txPayerKennitala_c is either 4,5 or 6. If those are all true it should be triggered. But it isn’t. I’m thinking that the REGEX part of is misconfigured. I can do this – use a LEFT() action to check the first letter and then pass that to the REGEX function that validates ? Or am I off-base?
Your REGEX
[4-6] {1}contains a space before the{1}. It’s validating that there’s a number 4, 5, or 6, and one space, but comparing only the LEFT first character oftxPayerKennitala__c. Change your REGEX to[4-6]{1}, and see if that helps.