+ Start a Discussion
CRMGeneralistCRMGeneralist 

Validation Formula

I have three fields Field A Field B and Field C

 

If Field  A is True then Field B is Required otherwise if Field A is False then Field C is Required. Can someone please tell me how to correctly write the formula, thanks.

Best Answer chosen by Admin (Salesforce Developers) 
NPMNPM
 

AND (A,ISNULL(B))

 

 

For the 1st one

 

 

AND (NOT(A),ISNULL(C))

 

 

For the 2nd one

 

If you want to try combining into one formula you would surround all this with OR

 

OR( AND (A,ISNULL(B)), AND (NOT(A),ISNULL(C)) )

Which is basically what hhuie suggested

 

 

All untested but should give you something to work with.

All Answers

hhuiehhuie

I think it's going to look like this:

 

( A && B = "" ) || ( NOT(A) && C="" )

 

 

Message Edited by hhuie on 02-23-2009 07:29 AM
NPMNPM

I think you might need 2 validation rules, one for field B and one for field C.

 

The syntax will depend on your field types.

CRMGeneralistCRMGeneralist

 Field A is a Check Box

 Field B is a Number

 Field C is a Currency

 

Basically Field A is saying is this a Basis Point?

 

If checked then Field B is required a Number Fee

If unchecked then Field C is required which is a Dollar Fee

 

Anyhelp appreciated.

NPMNPM
 

AND (A,ISNULL(B))

 

 

For the 1st one

 

 

AND (NOT(A),ISNULL(C))

 

 

For the 2nd one

 

If you want to try combining into one formula you would surround all this with OR

 

OR( AND (A,ISNULL(B)), AND (NOT(A),ISNULL(C)) )

Which is basically what hhuie suggested

 

 

All untested but should give you something to work with.

This was selected as the best answer
CRMGeneralistCRMGeneralist

THANK YOU EVERYONE FOR ALL YOUR HELP