0

Is there an alternative way to:

  1. Add "$" prefix to the product of (SHIPPING FEE * USD CONVERTION RATE)
  2. ROUND UP (SHIPPING FEE * USD CONVERTION RATE) to the nearest 10 dollars or nearest 100 dollars

What I did:

  1. Created a custom setting where I entered the USD CONVERTION RATE (1.3333).
  2. Created a formula field called USD SHIPPING FEE. The formula is:

*CEILING($Setup.Custom_Exchange_Rate * Shipping Fee)*

enter image description here

The compile size is 338 characters but I can't save it because of the error.

Note that SHIPPING FEE is just a currency field where users manually enter the value.

1
  • 3
    the error mentions that other formula fields referencing this field are getting too big. Maybe it's worth putting those formulas in the question as well and see if we can make those more efficient. Oct 10, 2016 at 20:52

1 Answer 1

1

The maximum compiled size is the total number of compiled formulas on an object. Most likely, you're already brushing up against the limit, so you'll need to optimize your other formulas to get this one to work.

Alternatively, create a new text field, make it read-only, and set a workflow rule to populate the value every time the record is saved. Workflow formula field updates do not count against the object's compiled formula size.

Also, see the Formula Size Tip Sheet for more information on how to optimize your formula usage.

8
  • @sfdxfox - The docs state "The compile size is the size of the formula (in bytes) including all of the fields, values, and formulas it references". I read this as each formula field dues to the wording "size of the formula". It does not say all formula fields count toward an object limit regardless of if they have no reference to each other. Maybe I am reading your answer incorrectly??
    – Eric
    Oct 11, 2016 at 3:22
  • 2
    @Eric No, you're not imagining things. There really is a per-object formula limit. The docs are not clear on this, but this is something you need to be aware of when writing formulas. This is often why you can "calculate compiled size" and it'll give you a small number, yet when you save it'll fail.
    – sfdcfox
    Oct 11, 2016 at 3:28
  • 1
    Doc update request time
    – Eric
    Oct 11, 2016 at 3:30
  • @Eric I've been barking up that tree for years...
    – sfdcfox
    Oct 11, 2016 at 3:37
  • 1
    yea, but they finally delivered the Approval comments being able to be used in merge fields for emails other than on the approver assignment notification. Only took 7 or so year with like 100K votes. Just proves there is hope, albeit nothing I would hold my breath on lol.
    – Eric
    Oct 11, 2016 at 3:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .