Formula Evaluation Order

Formula evaluation occurs within the Set methods for each control.  The Set method is called from within the DataBind right after the LoadData function is called to load the data from the database.  Microsoft .NET Framework does not guarantee the order in which the DataBind will be called for each control within the page.  For example, if there are two record controls side-by-side, there is no guarantee that the top-left record control’s DataBind will be called prior to the DataBind of the lower-right control on the page.  Specifying a formula in the second record control that uses a value from the first record control may or may not work based on the order in which Microsoft .NET Framework calls the DataBind method.

If the controls have a parent-child relationship, then the parent will always be loaded first prior to the child since the Id of the parent is required to load the children.  This ensures that child controls can access the parent controls without any problem.

If there is a need to initialize the value of a control from a value of another control, the best approach is to use the database record value instead of the control value, since the LoadData will have loaded the database record prior to the DataBind method being called.  Since the database record is loaded as a whole, there is no problem using other fields within the database record.  Similarly, parent database records are also available for use in initializing other user interface controls.

See Also

Variables Available in Formulas

Formula Evaluation Order

Indexing

Using Table and Record Control Functions in Formulas

Using .NET Framework Functions in Formulas

Using Custom Functions in Formulas

Formula Error Reporting