You need to sign in to do that
Don't have an account?
Priyanka Lukose
Question about string comparison in validation rule
Hi All, I am new to Salesforce, doing some hands on exercise. How do we perform string comparison in validation rules, My requirement is there are 2 text fields on same web page,the text entering in A field should match the text entering in B. I tried usingNOT( Contains(A,B)).While entering inputs though both values in A and B matches it throws the err msg that I have kept in Validation rule
I have two suggestions. Try using this to ensure that they are the same otherwise A=race and B=racecar would pass your validation
NOT(A = B)
Also might want to make sure your validation rule is active.
Hope this helps!
AM
Its straightforward comparison. For eg: I have two custom field Authorized_Signatory_First_Name__c and Authorized_Signatory_Last_Name__c then i will use, you can use the same logic for standard fields or combination of standard and custom field.
Authorized_Signatory_First_Name__c <> Authorized_Signatory_Last_Name__c
There are few more points I forgot to mention in the above question
Requiremant is
2 textboxes B and A(Api name are B and A)
text entering in A should match B else throw an exception
B is actally of master-detail with Object 1
was able to solve it using NOT(CONTAINS(A,object1__r.B) )
wondering Why the require err msg was not showing when i used below
NOT(CONTAINS(A,B__c) )
Please advice
Object 1 has a field of datatype text
Object 2 has 2 fields A and B
A text
B of master detail relation ship with Object 1
Requirement is text in A and B should match else should throw an err message
I tried using But dint work
Not(contains(A,B_c))
Worked when changed formula to
NOT(Contains(A,object1__r.B))
My question is why the first formula dint work when I directly refer to the text B of same object