[SalesForce] Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5,459 characters). Maximum size is 5,000 characters

I have a Formula Field(Time_Spent_Technology_Setup_Number__c) to stop calculating time based on the Status.
Whenever i am trying to save the field it is throwing below error: (In the logic I am not referencing any formula fields, I am using only Date fields)

Formula(s) that reference this field are no longer valid: Compiled formula is too big to execute (5,459 characters). Maximum size is 5,000 characters (Related field: Formula)

Here is my Logic :

if (or(ISPICKVAL(Status__c ,'Cancelled'),DateAssignedBusiness__c=null),null,
if (not isnull(DateAssigned_ThirdParty__c),DateAssigned_ThirdParty__c- DateAssignedBusiness__c,
if (not isnull(DateAssigned_Technology__c),DateAssigned_Technology__c - DateAssignedBusiness__c,
if (ISPICKVAL(Status__c ,'Closed'),Closed_Date__c - DateAssignedBusiness__c,
Now()- DateAssignedBusiness__c))))

Can anyone please help me on how to minimise my formula?

Best Answer

If you did this in workflow with a field update, the formula is unlimited in size. The main drawback to this approach is that the data only updates when the item is updated while formula fields 'update' when they are accessed.

Set the workflow to always fire. let it take all of the data and calculate a response and update a standard field. (resultA)

Then use the formula field to compare that result (resultA) with the items that change as the day changes. (for example: 'days between A and Z < 14' etc)

This way you can have a single call in the formula to a standard field.

Related Topic