Skip to main content
I am currently trying to create a validation rule to enforce users to type in the correct spelling and capitolization for a text field. If a user manually enters Void, Approved or Error in a text field it needs to have the first letter capitolized and the correct spelling. 

 

I currently have this VR set up, the first half of the VR works fine until I add in the correct spelling portion. 

 

AND (OR(ISNEW(),ISCHANGED(ChargentOrders__Response_Status__c)), NOT(REGEX(LEFT(ChargentOrders__Response_Status__c,1), "[A-Z]{1}[A-Z,a-z]*")) OR(ChargentOrders__Response_Status__c  =  "Approved", ChargentOrders__Response_Status__c  =  "Void",  ChargentOrders__Response_Status__c  =  "Error"))
8 respostas
  1. 3 de abr. de 2019, 15:37

    Try this:

    AND(

    OR(

      ISNEW(),

      ISCHANGED(ChargentOrders__Response_Status__c)

    ),

    CASE(LOWER(ChargentOrders__Response_Status__c),

    "error",1,

    "void",1,

    "approved",1,

    0)=1,

    CASE(ChargentOrders__Response_Status__c,

    "Error",1,

    "Void",1,

    "Approved",1,

    0)=0

    )

     

     
0/9000