Skip to main content
I keep getting the following error on a formula field in a custom object: 

 

Incorrect number of parameters for function 'IF()'. Expected 3, received 4 (Related field: Formula)

 

Here is my formula (using placeholders for custom fields obviously; if this doesn't make sense let me know). I understand that this error is usually caused by missing the 'ELSE' result, but I have that here so I'm not sure what could be causing it.

 

IF(PricebookEntry.Product_Family__c = 'A', CustomObjectCustomField__c, 0,

 

IF( PricebookEntry.Product_Family__c = 'B',  CustomObjectCustomField__c , 0,

 

IF ( PricebookEntry.Product_Family__c = 'C',   CustomObjectCustomField__c  , 0,

 

0)))
8 个回答
  1. 2018年2月20日 13:51
    Hi Kristy,

     

    Correcting : Try something like this:

     

    CASE(

     

    PricebookEntry.Product_Family__c ,  

     

    'A' , CustomObjectCustomField__c ,

     

    'B' , CustomObjectCustomField__c ,

     

    'C' , CustomObjectCustomField,

     

    0

     

    )
0/9000