+ Start a Discussion
NIKHIL_SFDCNIKHIL_SFDC 

Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute

Hi

 

I am using a formula-

if( checkbox__c =true, DateTime__c- CreatedDate , now()-CreatedDate )

 

When I click ''Check Syntax' button then there is no error andCompiled sise is 207 characters, but when I tried to save it, this is showing error "Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (16.122 characters). Maximum size is 5.000 characters".

This is very basic and small formula, I wonder why this is showing error.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
NIKHIL_SFDCNIKHIL_SFDC

Got the solution..

 

To acheive this we need to create 4 fields (actually we need to split the code).

 

Num_Days__c (Number type)=if( checkbox__c = true, DateTime__c - CreatedDate, now() - CreatedDate)

Num_Hours__c (Number type)=Num_Days__c * 24

Num_Minutes__c (Number type)=Num_Hours__c * 60

 

Formula1__c (Text type) =TEXT( FLOOR( Num_Days__c )) & " Days " & TEXT( FLOOR( MOD( Num_Hours__c, 60 ) ) ) & " Hours " & TEXT( ROUND( MOD( Num_Minutes__c , 60 ), 0 ) ) &" Minutes"

 

We need to show only Formula1__c.

 

All Answers

gitugitu

Hello,

 

I was able to save the formula correctly in my org. Are you sure there are no invisible characters inadvertently introduced?

NIKHIL_SFDCNIKHIL_SFDC

Thanks Gitu for your quick reply,

Now I can save this formula, but facing another problem releted to this--

Formula__c (Number type)=if( checkbox__c =true, DateTime__c- CreatedDate , now()-CreatedDate ) *24

 

I am trying to show this in "Days hours and minutes".

 

Formula1__c (Text type) = text(floor( Formula__c/24 )) & " Days " & text(floor( (Formula__c/24-floor( Formula__c/24))* 24)) &" Hours " &  text(round( (round(((Formula__c/24-floor( Formula__c/24))* 24),8)-floor(round(((Formula__c/24-floor( Formula__c/24))* 24),8)))*60,0)) &" Minutes"

 

This is thowing error (even I have tried this).

 

SFDC_VikashSFDC_Vikash

Hi,

 

You will not be able to create the specified formula, because it will cross the character limit for formula as you are referencing the other formula field in this, character of other formulas will also make count in this.

NIKHIL_SFDCNIKHIL_SFDC

Thank you Vikash for you interest and reply.

I know this is exceeding the limit of 5000 characters.

Please help me to display such thing in formula field (I meant by in Days, hours and Minutes format).

NIKHIL_SFDCNIKHIL_SFDC

Got the solution..

 

To acheive this we need to create 4 fields (actually we need to split the code).

 

Num_Days__c (Number type)=if( checkbox__c = true, DateTime__c - CreatedDate, now() - CreatedDate)

Num_Hours__c (Number type)=Num_Days__c * 24

Num_Minutes__c (Number type)=Num_Hours__c * 60

 

Formula1__c (Text type) =TEXT( FLOOR( Num_Days__c )) & " Days " & TEXT( FLOOR( MOD( Num_Hours__c, 60 ) ) ) & " Hours " & TEXT( ROUND( MOD( Num_Minutes__c , 60 ), 0 ) ) &" Minutes"

 

We need to show only Formula1__c.

 

This was selected as the best answer
kiran kumar 117kiran kumar 117
Hello Nikhil,

The foremost formula that was giving error was changed by you introducing 4 fields. Thats nice ! But what I would like to know is how will we understand how to change the formula to ensure that there is no error.  Now I have a scenario, where the user is using a formulae, and he is receiving error. How should I modifiy the formula so that I see no error .

 
Libor MichalekLibor Michalek
Hi just came accross this, I have similar issue, but do not know what formulas,fields are included in the chain I believe I'm trying to change something in the middle, how do I find subsequent realted fomulas/fields?