Best practice when using snapshots
In a rule associated with a property of a class used in CRUD management, this.PROPERTY
gives you access to the value of the property.
this.snapshot.PROPERTY
gives you access to the previous value of the property.
Using a snapshot makes it easy to handle update controls. Let's see the following examples:
# Let's compare the current value and its snapshot:
If this.snapshot.PROPERTY<>this.PROPERTY
# The current property has been modified
Endif
As a propagation rule triggers only after a successful modification, comparing the snapshot and the current value is useful. At the first propagation, they are different because the propagation rule has been triggered, but at the second modification, they might be equal if the user reverses the modification.