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
Chantal FournierChantal Fournier 

My Formula is too big to execute - Pretty silly

Like a lot of people here, I am getting a "formula is too big to execute" error. A lot of the exemples I have seen had fairly complex formulas but mine is pretty silly.
I have added product fields to my contracts and I want to add-up the price fields.
Former formula was:
prix_1__c  +  prix_2__c  +  prix_3__c  +  prix_4__c  +  prix_5__c  +  transport__c +  prix_6__c

I want to change it up to 
prix_1__c  +  prix_2__c  +  prix_3__c  +  prix_4__c  +  prix_5__c  +  prix_6__c +  prix_7__c  +  prix_8__c  +  prix_9__c  +  prix_10__c  +  prix_11__c  +  prix_12__c
Each of the field I am refering too is a 3 character text field. There is no way that should bring me over 5000 characters.
In the previous version, 4 of the fields were text and the others were currency and it worked (not sure how that worked.) Now I have changed them all to text and no dice.

Thank you.
Best Answer chosen by Chantal Fournier
Dev_AryaDev_Arya
Hi, 
instead of changing to text, why dont you change all of them to currency, that should be the right format.
Anyways, if the formulae is too big, split it in to multiple formulaes, for ex:
formulae1 = prix_1__c  +  prix_2__c  +  prix_3__c  +  prix_4__c  +  prix_5__c  +  prix_6__c;
formulae2 = prix_7__c  +  prix_8__c  +  prix_9__c  +  prix_10__c  +  prix_11__c  +  prix_12__c;
formulae3 = formulae1 + formulae2;
This should work. This has worked for me in the past :-)

Cheers.
 

All Answers

Dev_AryaDev_Arya
Hi, 
instead of changing to text, why dont you change all of them to currency, that should be the right format.
Anyways, if the formulae is too big, split it in to multiple formulaes, for ex:
formulae1 = prix_1__c  +  prix_2__c  +  prix_3__c  +  prix_4__c  +  prix_5__c  +  prix_6__c;
formulae2 = prix_7__c  +  prix_8__c  +  prix_9__c  +  prix_10__c  +  prix_11__c  +  prix_12__c;
formulae3 = formulae1 + formulae2;
This should work. This has worked for me in the past :-)

Cheers.
 
This was selected as the best answer
Chantal FournierChantal Fournier
Hello Arya,
It didn't work. I think it's a problem with that one field because I created another exactly the same and it worked. So I just stopped using the "defective" field.
Thank you,
Dev_AryaDev_Arya
:-P , m glad you figured it out. cheers