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
Derek RainesDerek Raines 

Validation Rule: Restrict Multiple Checkbox Selection Syntax Error

Hey all! I am trying to create a lengthy IF statement that will restrict users from selecting more than a single checkbox at a time. I am receiving this  syntax error-

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

Here is my attempted validation rule syntax. Any insights on how to resolve this? Thank you!

(IF(Additional_Closing_Auth_Reasons__c , 1, 0) + IF(ApprovedRepaymentStructureChanges__c , 1, 0) + IF(Borrower_Change__c , 1, 0) + IF(Approved_Special_Conditions_Change__c , 1, 0) + IF(Borrower_Added__c , 1, 0) + IF(Borrower_Removed__c , 1, 0) + IF(Construction_Advance_Changes__c , 1, 0) + IF(Guarantor_Added_custom__c , 1, 0) + IF(LLC_BI__Guarantor_Removed__c , 1, 0) + IF(Loan_Amount_Increased_Beyond_25k__c , 0) + IF(Loan_Information_Change__c , 0) + IF(OriginalApprovedCollateralChanges__c , 0) + IF(OriginalApprovedGuarantorChange__c , 0) + IF(Primary_Depository_or_AFT_Change__c , 0) + IF(Remove_Minor_Post_Closing_Reqs__c , 0) + IF(Remove_Minor_Pre_Closing_Reqs__c , 1, 0)) > 1

Derek RainesDerek Raines
(IF(Additional_Closing_Auth_Reasons__c , 1, 0) + IF(ApprovedRepaymentStructureChanges__c , 1, 0) + IF(Borrower_Change__c , 1, 0) + IF(Approved_Special_Conditions_Change__c , 1, 0) + IF(Borrower_Added__c , 1, 0) + IF(Borrower_Removed__c , 1, 0) + IF(Construction_Advance_Changes__c , 1, 0) + IF(Guarantor_Added_custom__c , 1, 0) + IF(LLC_BI__Guarantor_Removed__c , 1, 0) + IF(Loan_Amount_Increased_Beyond_25k__c , 0) + IF(Loan_Information_Change__c , 0) + IF(OriginalApprovedCollateralChanges__c , 0) + IF(OriginalApprovedGuarantorChange__c , 0) + IF(Primary_Depository_or_AFT_Change__c , 0) + IF(Remove_Minor_Post_Closing_Reqs__c , 0) + IF(Remove_Minor_Pre_Closing_Reqs__c , 1, 0)) > 1
Raj VakatiRaj Vakati
try this
 
IF(
(IF(Additional_Closing_Auth_Reasons__c , 1, 0) +
 IF(ApprovedRepaymentStructureChanges__c , 1, 0) + 
 IF(Borrower_Change__c , 1, 0) +
 IF(Approved_Special_Conditions_Change__c , 1, 0) + 
 IF(Borrower_Added__c , 1, 0) +
 IF(Borrower_Removed__c , 1, 0) +
 IF(Construction_Advance_Changes__c , 1, 0) + 
 IF(Guarantor_Added_custom__c , 1, 0) + 
 IF(LLC_BI__Guarantor_Removed__c , 1, 0) + 
 IF(Loan_Amount_Increased_Beyond_25k__c , 0) + 
 IF(Loan_Information_Change__c , 0) + 
 IF(OriginalApprovedCollateralChanges__c , 0) +
 IF(OriginalApprovedGuarantorChange__c , 0) + 
 IF(Primary_Depository_or_AFT_Change__c , 0) + 
 IF(Remove_Minor_Post_Closing_Reqs__c , 0) + 
 IF(Remove_Minor_Pre_Closing_Reqs__c , 1, 0)) > 1 , true ,false)

 
Derek RainesDerek Raines
Thank you for the reply! I gave it a go and am still receiving the same error.

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2
Alain CabonAlain Cabon
These IF conditions have only two parameters instead of three between the parenthesis:

1) Loan_Information_Change__c 
2) 0


IF(Loan_Information_Change__c , 0) +
IF(OriginalApprovedCollateralChanges__c , 0) +
IF(OriginalApprovedGuarantorChange__c , 0) +
IF(Primary_Depository_or_AFT_Change__c , 0) +
IF(Remove_Minor_Post_Closing_Reqs__c , 0) +

With three parameters:

IF(Loan_Information_Change__c ,1, 0) +
IF(OriginalApprovedCollateralChanges__c , 1, 0) +
IF(OriginalApprovedGuarantorChange__c , 1, 0) +
IF(Primary_Depository_or_AFT_Change__c ,1,  0) +
IF(Remove_Minor_Post_Closing_Reqs__c ,1, 0) +

1) Loan_Information_Change__c 
2) 1
3) 0