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
petec@i2isyspetec@i2isys 

Incorrect number of parameters for function 'CASE()'. Expected 2, received 2

Hi,
I'm trying to create a validation rule that checks to see if the Primary Campaign Source is on the Opportunity record AND if the Opportunity is New AND if any of the four Opportunity Types are in play.  Below is my formula.  But I'm getting an error that says expected 2 parameters and received 2.  I've never seen that before, usually the numbers don't match.  Any ideas?

AND(
ISNULL( Campaign.Id ),
ISNEW(), 
OR(
CASE( Type , "Business Development (New Business)"),
CASE( Type , "Payer (New Business)"),
CASE( Type , "Perpetual (New Business)"),
CASE( Type , "Subscription (New Business)")))
Best Answer chosen by petec@i2isys
Raj VakatiRaj Vakati
This is wokring
 
AND( 
ISBLANK( CampaignId ), 
ISNEW(), 
OR( 
Text(Type)= "Business Development (New Business)", 
Text(Type)= "Payer (New Business)", 
Text(Type)= "Perpetual (New Business)", 
Text(Type)= "Subscription (New Business)" 
) 
)

 

All Answers

Raj VakatiRaj Vakati
Use this 
 
AND(
ISNULL(Campaign.Id ),
ISNEW(), 
OR(
Text(Type)== "Business Development (New Business)",
Text(Type)== "Payer (New Business)",
Text(Type)== "Perpetual (New Business)",
Text(Type)== "Subscription (New Business)"
)
)

 
petec@i2isyspetec@i2isys
Ok, that stopped the syntax error, but the validation rule didn't work when I created a new opportunity that was of one of the New Business Types and no Primary Campaign Source.
 
petec@i2isyspetec@i2isys
And yes, the rule is activated.
Raj VakatiRaj Vakati
What all the conditions you want 
Raj VakatiRaj Vakati
This validation looks good for me  .. Check the text values
 
AND(
ISNULL(Campaign.Id),
ISNEW(), 
OR(
Text(Type)== "Business Development (New Business)",
Text(Type)== "Payer (New Business)",
Text(Type)== "Perpetual (New Business)",
Text(Type)== "Subscription (New Business)"
)
)

 
Raj VakatiRaj Vakati
Got it

Use this
 
AND(
ISNULL( CampaignId ),
ISNEW(), 
OR(
Text(Type)== "Business Development (New Business)",
Text(Type)== "Payer (New Business)",
Text(Type)== "Perpetual (New Business)",
Text(Type)== "Subscription (New Business)"
)
)

 
Raj VakatiRaj Vakati
This is wokring
 
AND( 
ISBLANK( CampaignId ), 
ISNEW(), 
OR( 
Text(Type)= "Business Development (New Business)", 
Text(Type)= "Payer (New Business)", 
Text(Type)= "Perpetual (New Business)", 
Text(Type)= "Subscription (New Business)" 
) 
)

 
This was selected as the best answer
petec@i2isyspetec@i2isys
Ah, yes, that was it, the ISNULL didn't work but the ISBLANK does work, thank you so much!