You need to sign in to do that
Don't have an account?
Paweł Woźniak
Why CASESAFEID() is so expensive in formulas and how to workaround this?
Hi,
I have an junction object with three lookup fields to three budget types (other objects). They are filled in depended on selected record type.
As result of formula I want to have 18 character Id.
Formula:
Compiled size: 523 characters. Great but it returns 15char Id. Lets use CASESAFEID()
Error: Compiled formula is too big to execute (9,780 characters). Maximum size is 5,000 characters.
Error: Compiled formula is too big to execute (8,374 characters). Maximum size is 5,000 characters
Why is it that expensive? Is there a way to wokaround this?
I have an junction object with three lookup fields to three budget types (other objects). They are filled in depended on selected record type.
As result of formula I want to have 18 character Id.
Formula:
CASE(RecordType.Name, 'Product Budget', EMS_Product_Budget_gne__r.Id, 'Region Budget', EMS_Region_Budget_gne__r.Id, EMS_Territory_Budget_gne__r.Id)
Compiled size: 523 characters. Great but it returns 15char Id. Lets use CASESAFEID()
CASESAFEID( CASE(RecordType.Name, 'Product Budget Allocation', EMS_Product_Budget_gne__r.Id, 'Region Budget Allocation', EMS_Region_Budget_gne__r.Id, EMS_Territory_Budget_gne__r.Id) )
Error: Compiled formula is too big to execute (9,780 characters). Maximum size is 5,000 characters.
CASE(RecordType.Name, 'Product Budget Allocation', CASESAFEID( EMS_Product_Budget_gne__r.Id), 'Region Budget Allocation', CASESAFEID( EMS_Region_Budget_gne__r.Id), CASESAFEID( EMS_Territory_Budget_gne__r.Id) )
Error: Compiled formula is too big to execute (8,374 characters). Maximum size is 5,000 characters
Why is it that expensive? Is there a way to wokaround this?
See the articles below, will help,
http://www.crmverse.com/four-solutions-to-salesforce-com-too-big-to-execute-formula-error/
https://help.salesforce.com/HTViewSolution?id=000005456&language=en_US
https://help.salesforce.com/help/pdfs/en/salesforce_formula_size_tipsheet.pdf
Also see few similar threads,
https://success.salesforce.com/answers?id=90630000000gsYIAAY
https://success.salesforce.com/answers?id=90630000000h3emAAA
Regards,
Ashish
maybe you can put the 18 digit ids in text fields on each object and use these text fields in your formula.
1) create a new text field on each object ex. 18digit id,
2) create a workflow rule
-evaluate the rule when a record is created, and every time it’s edited
-rule criteria: the above text field is blank ex. Objectname: 18digit id equals null
3) add a field update action to update the text field
Specify New Field Value: CASESAFEID(Id)
you need to update the extisting records to fire the wf and then it can work
It will likely be expensive as it is doing the complete suffix calculation each time. See What are Salesforce ID's composed of? (http://salesforce.stackexchange.com/a/1663/102)
Consider voting for the idea: Reduce the compiled formula character cost of CASESAFEID() (https://success.salesforce.com/ideaView?id=0873A000000cMmeQAE)