function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pmozz01pmozz01 

Please Help with this Validation Rule

I need to have a validation rule that does the following:

 

If  picklist field Type=Claim*, then require that picklist field Resolution, picklist field Product Quantity and number field Amount are completed. I have put into place the validation rule below, however it does not let me save even if all 4 fields have values in it.  I think it is the way the field Type=Claim* is written, but I have not been successful in figuring this out.

 

Thanks!

 

AND(
OR(
(ISPICKVAL( Type, "Claim*")),
ISPICKVAL ( Resolution__c , ""),
ISPICKVAL( Product_Size__c , ""),
(Amount__c <> 0)))

 

Best Answer chosen by Admin (Salesforce Developers) 
IspitaIspita

Hi ,

Please do try the following :-

 

AND( ISPICKVAL( Type, "Claim*"), OR(Len(text(Resolution__c ))<1, Len(text(Product_Size__c))<1,Amount__c < 0))

 

Do try it and let me know if it resolves your issue....

 

All Answers

IspitaIspita

Hi,

 

So you want that if field "Type" has value "Claim*" and other 3 fields should have not null and non zero values respectively.

try the following and let me know:-

   AND( ISPICKVAL( Type, "Claim*"), Len(text(Resolution__c ))<1, Len(text(Product_Size__c))<1,Amount__c < 0)

 

Hope this helps...

pmozz01pmozz01

I created the validation rule as specified, but it does not create an error at any time.  Currently, I have put 3 separate rules in place for each of the required field when the Claim value is selected.  Thanks.

IspitaIspita

Hi ,

Please do try the following :-

 

AND( ISPICKVAL( Type, "Claim*"), OR(Len(text(Resolution__c ))<1, Len(text(Product_Size__c))<1,Amount__c < 0))

 

Do try it and let me know if it resolves your issue....

 

This was selected as the best answer
pmozz01pmozz01

Thank you!!! Works perfectly.

IspitaIspita

If it works fine please do mark the post having the solution as an accepted solution so that others too may get the benefit :)