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
Selvakumar Anbazhagan 12Selvakumar Anbazhagan 12 

Error in Opportunity Formula Field

Hi,

I having issue to create a new formula field in opportunity. when i was tried to create it shows me the below error 

Error: Incorrect number of parameters for function 'CASE()'. Expected 6, received 7..

My formula is :

OR
(CASE(Owner.Profile.Name, 
"Account Executive", "Outbound", 
"Commercial Bulk Executive", "Bulk", 
"Inbound Sales", "Inbound", 
"Outside Sales Agent", "Agent", 
"Sales Director/Manager", "Mgmt", 
"System Administrator", "Admin", 
"Other" 
),
CASE(Owner.Profile.Name, 
"Maria Martinez", "Agent",
"Michael Smith​","Carrier",
"Robert Johnson","Carrier"
),
if(RecordType.Name="Carrier Devices","Carrier","Other")
)



Any help on this.

Thanks.
Akhil AnilAkhil Anil
Hi,

Can you help us understand what are you trying so that we can frame the right formula for you ?
shivani desai 3shivani desai 3
An else condition is missing for the CASE FORMULA here CASE(Owner.Profile.Name, 
"Maria Martinez", "Agent",
"Michael Smith​","Carrier",
"Robert Johnson","Carrier"
),

It might solve the error if you add a "," there with blank value. If this solves your problem like this answer.
Selvakumar Anbazhagan 12Selvakumar Anbazhagan 12
Hi,

Even am getting error.

Actually i want a formula field in opportunity to categorize the channels (Inbound,outbound,Agent or Carrier) from various objects (Profile,Opportunity,Recordtype).

So i created the below logic.

OR
(CASE(Owner.Profile.Name, 
"Account Executive", "Outbound", 
"Commercial Bulk Executive", "Bulk", 
"Inbound Sales", "Inbound", 
"Outside Sales Agent", "Agent", 
"Sales Director/Manager", "Mgmt", 
"System Administrator", "Admin", 
"Other" 
),  /* Categorize channel using Profile */
CASE(Opportunity.Owner.Name, 
"Maria Martinez", "Agent",
"Michael Smith​","Carrier",
"Robert Johnson","Carrier",
"Other"
),  /* Categorize channel using owner name */
if(RecordType.Name="Carrier Devices","Carrier","Other")
)   /* Categorize channel using  recordtype */


Is this makes sense ?

Thanks.