+ Start a Discussion
jisaacjisaac 

Two "OR" statements and one "And" help

I need to create a workflow rule to alert a Business Unit Manager if the stage has changed on any of his 3 teams' deals for either of 2 specific types of Opportunities.

So there are 2 "OR" statements using PickVals. One is to determine if the Business Unit is one of his and another to determine if the Opportunity Type is one of two he wants to be alerted on.

And then I want the statement to be true if the Stage in one of these opps changes.



Here's what I came up with, but the syntax is wrong:

And(
OR(IsPickVal( BUOpportunityType__c ,"New Core Sale"),( ISPICKVAL( BUOpportunityType__c ,"Migration from Legacy Core"))),
OR(IsPickVal( OSI_Business_Unit__c  ,"CSG CU Sales - Major"),( ISPICKVAL( OSI_Business_Unit__c   ,"CSG CU Sales SME")),(OSI_Business_Unit__c , "OSC-BSG")))),
IsChanged(StageName)
)


Can someone help me fix this?

Thanks so much,
Jane


Best Answer chosen by Admin (Salesforce Developers) 
NPMNPM

Try this (untested) to see if it helps.

Code:
And(
    OR(IsPickVal( BUOpportunityType__c ,"New Core Sale"),IsPickVal( BUOpportunityType__c ,"Migration from Legacy Core")),
    OR(IsPickVal( OSI_Business_Unit__c ,"CSG CU Sales - Major"),IsPickVal( OSI_Business_Unit__c,"CSG CU Sales SME"),IsPickVal(OSI_Business_Unit__c ,"OSC-BSG")),
   IsChanged(StageName)
   ) 


 

All Answers

NPMNPM

Try this (untested) to see if it helps.

Code:
And(
    OR(IsPickVal( BUOpportunityType__c ,"New Core Sale"),IsPickVal( BUOpportunityType__c ,"Migration from Legacy Core")),
    OR(IsPickVal( OSI_Business_Unit__c ,"CSG CU Sales - Major"),IsPickVal( OSI_Business_Unit__c,"CSG CU Sales SME"),IsPickVal(OSI_Business_Unit__c ,"OSC-BSG")),
   IsChanged(StageName)
   ) 


 

This was selected as the best answer
jisaacjisaac
Excellent! Thank you so much - it worked!

jane