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
janeisaacjaneisaac 

OR and IF statement formula help needed

We have an alert field on the Opportunity object  that shows a red flashing light if any the three statements are true. And now I have another field that will show the reason why it is red. I want the formula to enter the language that is in the quotes into the new field.

 

The first two fields are checkboxes and the last is a comparison between the amount of the Opp and the Credit Limit on the account.

 

I started to use Case but could not get it to work so went to the IF operative - still no luck. Here is what I have so far:

 

OR(
IF(Account.Credit_Hold__c , "True", "There is a Credit Hold on this Account"),
IF(Account.Permanent_Hold__c , "True", "There is a permanent hold on this Account"),
IF(Account.Credit_Limit__c < Amount, "The Amount of this Opportunity exceeds the Credit Limit of this Account"), "not applicable")

 

However, the syntax error says that it got an incorrect number of parameters for function IF(). Expected 3,received 2.

 

I also wonder what will happen if more than one of these are true.

 

Anyone have any ideas for me? Thanks so much.

 

Jane



Best Answer chosen by Admin (Salesforce Developers) 
janeisaacjaneisaac

Actually, Steve's first one did not work but he kept at it and got the following to work:

 

IF(Account.Credit_Hold__c = TRUE, "There is a Credit Hold on this Account",

IF(Account.Permanent_Hold__c = TRUE, "There is a permanent hold on this Account",

IF(Account.Credit_Limit__c < Amount, "The Amount of this Opportunity exceeds the Credit Limit of this Account", "not applicable")))

 

 

Big thanks to SteveMo!



 

All Answers

Steve :-/Steve :-/

Hi Jane give this one a shot:

 

Cheers!

IF(Account.Credit_Hold__c , "True", "There is a Credit Hold on this Account",
IF(Account.Permanent_Hold__c , "True", "There is a permanent hold on this Account",
IF(Account.Credit_Limit__c < Amount, "The Amount of this Opportunity exceeds the Credit Limit of this Account", "not applicable")))

 

janeisaacjaneisaac

Actually, Steve's first one did not work but he kept at it and got the following to work:

 

IF(Account.Credit_Hold__c = TRUE, "There is a Credit Hold on this Account",

IF(Account.Permanent_Hold__c = TRUE, "There is a permanent hold on this Account",

IF(Account.Credit_Limit__c < Amount, "The Amount of this Opportunity exceeds the Credit Limit of this Account", "not applicable")))

 

 

Big thanks to SteveMo!



 

This was selected as the best answer