Skip to main content

I've been staring at this too long, trying to get rid of all the syntax errors, and now I can't tell what's causing me problems!  Help!  

 

I need to define if an opportunity is new or existing business, based on when last purchases were made.  If an account has never purchased anything they're considered "white space" and will always be new.  If their last PACS purchase was more than 5 years (using 1826 days), then when they create a PACS opportunity it should be considered new.  If their last MS purchase was more than 5 years ago, then when they create a DR or WH opportunity it should be considered new.  Otherwise, if none of these conditions apply, then it's an existing customer.  

 

Here's what I've got:  

 

IF( 

OR(Account.White_Space__c = "Yes"), 

(AND( IsPickval(Opportunity_Type__c = "Synapse PACS"), ( CreatedDate -  Account.Last_PACS_Purchase__c > 1826))),

(AND( IsPickval(Opportunity_Type__c = "DR"), (CreatedDate -   Account.Last_MS_Purchase__c  > 1826))),

(AND( IsPickval(Opportunity_Type__c = "WH"), (CreatedDate -  Account.Last_MS_Purchase__c > 1826))),

"New", "Existing")

 

Here's the error I'm getting:  Error: Field Opportunity_Type__c is a picklist field. Picklist fields are only supported in certain functions.

 

I can't see any restrictions on picklist fields that would prevent me from using them in a formula like this.  What am I missing?  

5 commenti
0/9000