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
Ross JamesRoss James 

BR() - The fussy function

I am using line breaks in a formula - it is a mini help that pre-validates data and gives the user a hand.

 

In this example everything is fine.

 

 

CASE(  Status__c  , "New",   $Setup.Network_Trial_Help__c.New__c  ,  "Approved",  $Setup.Network_Trial_Help__c.Approved__c , "Hardware Issued",  $Setup.Network_Trial_Help__c.Hardware_Issued__c , "Agreement Received",  $Setup.Network_Trial_Help__c.Agreement_Received__c , "Hardware Returned",  $Setup.Network_Trial_Help__c.Hardware_Returned__c , "") &
IF(Number_of_Items__c<1,BR() & BR() & IMAGE("/img/samples/flag_red.gif" , "Red") & " You have not selected any Items " & IMAGE("/img/samples/flag_red.gif" , "Red"),"") &
IF( Account_Valid__c ="True", " The Account does not have a valid address " & IMAGE("/img/samples/flag_red.gif" , "Red") ,"")

 

Here, I am simply adding a line break between the last two IF statements

 

 

CASE(  Status__c  , "New",   $Setup.Network_Trial_Help__c.New__c  ,  "Approved",  $Setup.Network_Trial_Help__c.Approved__c , "Hardware Issued",  $Setup.Network_Trial_Help__c.Hardware_Issued__c , "Agreement Received",  $Setup.Network_Trial_Help__c.Agreement_Received__c , "Hardware Returned",  $Setup.Network_Trial_Help__c.Hardware_Returned__c , "") &
IF(Number_of_Items__c<1,BR() & BR() & IMAGE("/img/samples/flag_red.gif" , "Red") & " You have not selected any Items " & IMAGE("/img/samples/flag_red.gif" , "Red"),"") &
IF( Account_Valid__c ="True",BR() & " The Account does not have a valid address " & IMAGE("/img/samples/flag_red.gif" , "Red") ,"")

 

 

When doing so, the formula saves OK, but the result is always #error

 

It doesn't matter where I try and add the BR(), as long as it is AFTER the first IF statement, I get #error. I can add dozens, as long as they are in the first IF statement.

 

Does anyone have any idea what I am doing wrong?