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
jimmy2511jimmy2511 

IF Forumula clarification for a new field

Hey Everyone

 

I am working on a IF formula for a new field.

 

The formula is as follows:

OR(

IF(

ISPICKVAL( Type_of_Redemption__c, "Credit Note V" ), Total_Vouchers_Redeemed__c  *  Contract_Deal_Attribute__r.Groupon_Price__c  *  Contract_Deal_Attribute__r.Commission__c  *  Contract_Deal_Attribute__r.VAT__c , 0
), 

IF(

ISPICKVAL( Type_of_Redemption__c, "Credit Note C" ), Contract_Deal_Attribute__r.Groupon_Price__c * ( 1 +  Contract_Deal_Attribute__r.VAT__c ) * Commission_under_Credit_Note__c -  Contract_Deal_Attribute__r.Commission__c *   Total_Vouchers_Redeemed__c ) , 0

)


 However, I am recieving a Syntax error as there is no false statement, it expected 3 and received 2.

 

Any suggestions would be most warmly recieved.

 

Thank you.

 

Jimmy

Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below formula :

 

IF(ISPICKVAL( Type_of_Redemption__c, "Credit Note V" ), Total_Vouchers_Redeemed__c  *  Contract_Deal_Attribute__r.Groupon_Price__c  *

 Contract_Deal_Attribute__r.Commission__c  *  Contract_Deal_Attribute__r.VAT__c,

  IF( ISPICKVAL( Type_of_Redemption__c, "Credit Note C" ),Contract_Deal_Attribute__r.Groupon_Price__c * ( 1 +  Contract_Deal_Attribute__r.VAT__c )

* Commission_under_Credit_Note__c -  Contract_Deal_Attribute__r.Commission__c *   Total_Vouchers_Redeemed__c ,0))

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

jimmy2511jimmy2511

Hey,

 

Thank you for the response. The syntax is working but I am getting the Error message:

 

Error: Compiled formula is too big to execute (9,449 characters). Maximum size is 5,000 characters

 

Can you advise?

 

Cheers

 

Jimmy

Vz123Vz123

hi ,

 

formula field 1 =  IF(ISPICKVAL( Type_of_Redemption__c, "Credit Note V" ), Total_Vouchers_Redeemed__c  *  Contract_Deal_Attribute__r.Groupon_Price__c  *

 Contract_Deal_Attribute__r.Commission__c  *  Contract_Deal_Attribute__r.VAT__c, 0)

 

formula field 2 = IF( ISPICKVAL( Type_of_Redemption__c, "Credit Note C" ),Contract_Deal_Attribute__r.Groupon_Price__c * ( 1 +  Contract_Deal_Attribute__r.VAT__c )

* Commission_under_Credit_Note__c -  Contract_Deal_Attribute__r.Commission__c *   Total_Vouchers_Redeemed__c ,0))

 

formula field 3 =  IF(OR (formula field 1,formula field 2), true , false)

 

formula field will contain the corresponding value.