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
WPCMSWPCMS 

Validation: OR & ANDs

I have the formula below but I know I am not executing this correctly. The formula only works correctly on the Subtotal__c.

 

What am I missing?

 

 

 

Accounting_Period_Status__c ="Closed"&& 
ISCHANGED( Subtotal__c ) 
||ISCHANGED( Ready_to_Post_to_QuickBooks__c ) 
||ISCHANGED( Posting_Period__c ) 
||ISCHANGED( Period_Date__c ) 
||ISCHANGED( Date__c ) 
||ISCHANGED( Period__c ) 
||ISCHANGED( Do_Not_Post_to_QuickBooks__c ) 
||ISCHANGED( Do_Not_Print_Invoice__c ) 
||ISCHANGED( Sales_Tax_Amount__c ) 
||ISCHANGED( Sales_Tax_Percent__c ) 
||ISCHANGED( QB_Account__c ) 
||ISCHANGED( RequestQueue__c ) 
||ISCHANGED( QB_Invoice_Txn_ID__c ) 
||ISCHANGED( Master_Account__c ) 
||ISCHANGED( Vendor_Location__c ) 
||ISCHANGED( Transactionid__c ) 
||ISCHANGED( Change_QB_Date2__c ) 
||ISCHANGED( Custom_Description__c ) 
||ISCHANGED( Name ) 
||ISCHANGED( Invoice_Client_Note__c )

 

Thank you in advance.

 

Ritesh AswaneyRitesh Aswaney

Its just the precedence of operators, AND operates, before the OR

So you need all of you OR conditions included in braces after the AND,

 

i.e.Accounting_Period_Status__c ="Closed"  &&

(   //BRACES BEGIN FOR OR CONDITION

ISCHANGED( Subtotal__c ) ||

ISCHANGED( Ready_to_Post_to_QuickBooks__c ) ||

.....

 

) //BRACES END FOR OR CONDITION