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
Sascha DeinertSascha Deinert 

Parent.ID - CasesafeID - Formula too big

Hi,

I found the code below and it works fine if I use Name or ID, but I need the casesafeid from the parent Id.
If I will write the code below into a formula field, I get the error

Compiled formula is too big to execute (19.021 characters). Maximum size is 5.000 characters (Related field: Formula)

It is possible to change the code and I get also the casesafeid?
IF(LEN(Casesafeid({!Parent.Id})) < 1, Casesafeid({!Parent.Id}), 
IF(LEN(Casesafeid({!Parent.Parent.Id})) <1, Casesafeid({!Parent.Parent.Id}), 
IF(LEN(Casesafeid({!Parent.Parent.Parent.Id})) < 1, Casesafeid({!Parent.Parent.Parent.Parent.Id}), 
IF(LEN(Casesafeid({!Parent.Parent.Parent.Parent.Id})) < 1, Casesafeid({!Parent.Parent.Parent.Parent.Id}),  "Ultimate Parent Beyond 4 Levels"))))
Thanks,
Sascha
Best Answer chosen by Sascha Deinert
SF AdminSF Admin
Hi you are hitting the max chahracteer limit. 
check: https://help.salesforce.com/apex/HTViewSolution?urlname=Formula-field-exceeds-maximum-number-of-characters-1327109401516&language=en_US
so workaround for this is to use before update trigger.


Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.

Regards

All Answers

SF AdminSF Admin
Hi you are hitting the max chahracteer limit. 
check: https://help.salesforce.com/apex/HTViewSolution?urlname=Formula-field-exceeds-maximum-number-of-characters-1327109401516&language=en_US
so workaround for this is to use before update trigger.


Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.

Regards
This was selected as the best answer
Sascha DeinertSascha Deinert
Thanks for your reply, 

but I can't split the formula.
I can't use a workflow, because the parent is in more than one account, trigger is the same problem.

Do you have more ideas?

Thanks,
Sascha