Configuring Depends On Fields for a Formula
The ADF framework — unlike, say, a spreadsheet program — does not automatically infer what field(s) your Groovy scripts depend on.
For example, suppose that in a OrderLineItem
object, you added a formula
field named LineTotal
object having the following Groovy formula:
(nvl(UnitPrice_c,0) * nvl(Quantity_c,0)) * (1.00 - nvl(LineDiscountPercentage_c,0))
On its own, the ADF framework would not be able to automatically recalculate the line
total when the user changed the UnitPrice
, Quantity
,
or LineDiscountPercentage
Instead, you manually configure the
Depends On information for any field formulas need it. For example, the
figure below shows the Depends On multi-select list configured to reflect the
fields on which the LineTotal
formula depends. With this information
correctly configured, the LineTotal
will automatically update to
reflect the new value whenever any of the values of the field on which it depends is
changed.