+ Start a Discussion
Baz DensonBaz Denson 

flow field validation formula - 1 of 2 fields must be populated

This is driving me crazy, looks right to me but I'm missing something!

I need to validate a flow input. There are 2 fields, a date and a number. One of the fields must be populated. The date field validation is
 
AND (
    AND (
         NOT(ISBLANK({!End_Date})),
         NOT(ISNULL({!End_Date}))
    ),
    OR (
        ISNULL({!Number_of_Occurrances}),
        ISBLANK({!Number_of_Occurrances}),
        {!Number_of_Occurrances} = 0 
    )
)

and I have the opposite validation on the number field
Alexis KasperaviciusAlexis Kasperavicius
I didn't test this, but I'd start with something like below. This is formed as a record validation rule (ALL must be TRUE for error.) You'll need to insert your curly brackets for fields to use in flow. Try not to use ISNULL as they keep hinting it wil be deprecated.
(ISBLANK(dateBegins__c)=FALSE && ISBLANK(dateEnds__c)=FALSE && dateBegins__c > dateEnds__c) && (occurrance__c < 1 && ISBLANK(occurance__c)=FALSE)
PriyaPriya (Salesforce Developers) 
Hey Baz,

Try this :- 
AND (
 ISBLANK(dateBegins)<>True,
 ISBLANK(dateEnd)<>True,
ISBLANK(occurance)<>True,
Occurance <1)
)


Thanks & Regards,

Priya Ranjan