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
Rachel Linder 20Rachel Linder 20 

Checkbox Formula Field Not Responding as Expected

We have a checkbox field that uses a formula to decide when to check it or not. We have a case where formula "fails" all IF statetments until you reach the "Opportunity Year 1 Term equals 12, Opportunity Year 2 Term equals 12, and Quote Line Year equals Year 1". When it reacheds that statement it should check the box but this is not happening. Does anyone have any suggestions:
 
IF (
    Bookings_Override_True__c  = TRUE, TRUE,
      IF(
        Bookings_Override_False__c = TRUE, FALSE,
          IF(
            AND( Opportunity_Record_Type__c = 'Amendment', Line_Level_Detail__c = 'Customer Credit'), FALSE,
              IF(
                AND(Opportunity_Record_Type__c = 'Amendment', Line_Level_Detail__c <> 'Customer Credit'), TRUE,
                  IF(
                    AND(Opportunity_Record_Type__c <> 'Amendment',  Bookings_Override_False__c  = FALSE,  Bookings_Override_True__c  = FALSE, 
                      Line_Level_Detail__c = 'Services'), TRUE,
                        IF(
                          AND(Opportunity_Record_Type__c <> 'Amendment',  Bookings_Override_False__c  = FALSE,  Bookings_Override_True__c  = FALSE, 
                            Line_Level_Detail__c <> 'Services',  Line_Level_Type__c  = 'Removed Product'), TRUE, 
                              IF(
                                AND(  Opportunity.Year_1_Term__c   = 12, Opportunity.Year_2_Term__c  = 12,  QuoteLineYear__c  = 'Year 1'), TRUE,
                                  IF(
                                    AND(  Opportunity.Year_1_Term__c   <= 12, ISNULL( Opportunity.Year_2_Term__c ),  Year_Hidden__c  = 'Year 1'), true, 
                                      IF(
                                        AND(  Opportunity.Year_1_Term__c  < 12, Opportunity.Year_2_Term__c  = 12,  Year_Hidden__c  = 'Year 2'), true,
                                         false ) 
)
)
)
)
)
)
)
)

 
ShirishaShirisha (Salesforce Developers) 
Hi Rachel,

Greetings!

I can see that you have multiple if conditions due to which it might be not working as expected.So,I would suggest you to troubleshoot the formula by removing some of the if conditions to fix the issue.

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri