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
ANITHA BEEMU 2ANITHA BEEMU 2 

please help in formula

i need a formula on process builder,with critriea opportunity stage closed won,Referral (custom field) not null and contract term <3 years

i have conterm term a picklist field with values 12,24,36,48,60,72 all in months

for <3 years one formula
for  3 years one formula and 
for 4+ years one formula

i tired following one,getting error:
AND( 
OR( 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
OR( 
 NOT ( ISBLANK ( [Opportunity].Referral__c )  ), 
OR( 
ISPICKVAL([Opportunity].ContractTerm__c <36 )) ) 
)
)


please help me in this
 
Best Answer chosen by ANITHA BEEMU 2
Raj VakatiRaj Vakati
Try this 
 
AND( 
 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
 
ISPICKVAL([Opportunity].ContractTerm__c <36 )
 
)

 

All Answers

Raj VakatiRaj Vakati
Try this 
 
AND( 
 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
 
ISPICKVAL([Opportunity].ContractTerm__c <36 )
 
)

 
This was selected as the best answer
ANITHA BEEMU 2ANITHA BEEMU 2
HI Raj,Got following error by using the formula:

The formula expression is invalid: Field Opportunity is a picklist field. Picklist fields are only supported in certain functions.
Raj VakatiRaj Vakati
TRY THIS
 
AND( 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
ISPICKVAL([Opportunity].ContractTerm__c ,"36 ")
 
)

 
Santosh Bompally 8Santosh Bompally 8
You Chose Contract term as picklist, which means its a text field in the backend, So you cannot have <, > operations on this field, So you have to dump in all values. 

For <3 years
 
AND( 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
OR(ISPICKVAL([Opportunity].ContractTerm__c ,"12"),ISPICKVAL([Opportunity].ContractTerm__c ,"24"))

)

For = 3 years 
 
AND( 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
ISPICKVAL([Opportunity].ContractTerm__c ,"36 ")

)

For > 3 years 

 
AND( 
ISPICKVAL([Opportunity].StageName , "Closed Won"), 
 NOT ( ISBLANK ( [Opportunity].Referral__c ) ),
OR(ISPICKVAL([Opportunity].ContractTerm__c ,"48"),ISPICKVAL([Opportunity].ContractTerm__c ,"60"),ISPICKVAL([Opportunity].ContractTerm__c ,"72"))
)