Best Practices - Propagation Rules

The purpose of this document is to provide best practices for the propagate event, which is called on a property every time it is successfully modified after the control.

Principles

The reason for the latter rule is that it could create propagation loops. This can happen when the order in which data is stored is different from the order in which it is presented, or the order in which it will be set back into the database. Because of this, such algorithms are too unpredictable.

When a propagation rule is run, the order in which the fields are sent from the user interface can also depend on personalizations, as well as the communication mode.

Example

This is performed by the following code:

# This label is called from $PROPERTIES label in the script associated the class$PROPAGATE_Athis.B="AA"Return

In this example, field A should have value "AA", and field B should have value "BB". However, this code is too unpredictable because field B can end up with value "AA" if:

Use the following code to avoid this issue:

# This label is called from $PROPERTIES label in the script associated the class$PROPAGATE_AIf this.B<>""this.B="AA"EndifReturn

With this code, the propagation rule is only applied if no value is entered for field B. If, for any reason, you want to reapply the "AA" value to field B even if a value has been entered, the best solution is to implement a SET_B_VALUE method in the class, and to call it from a dedicated link called "Init B" in the representation.