Form data object changed
Triggering event – Abstract
This triggering event is only available on the form level and is triggered when the form data object and not only its content has changed.
e.g. a previously loaded data set with ID 523 is changed to a data set with ID 560.
In contrast to the triggering event Form data loaded, this event is not triggered if the same object has been loaded with changed values, but only if the loaded form data is actually another object.
Another data object is referred to when:
Another data set is loaded into the form (e.g. Shipment 51 and then Shipment 52).
The current data set has been saved and thus reloaded into the form.
A new, unsaved data set has been loaded into the form (e.g. user presses the 'New' ribbon).
The following client object is transferred to the behaviour component as a value:
{
from: oldFormData,
//zuvor geladene Formdaten
to: currentFormData,
//aktuell geladene Formdaten
}
Tip: The event is triggered before the 'changed' events, so that flags and variables can be reset.
Tip: If it is necessary to distinguish between 'Save' and a completely different data set, the 'id' field of the two objects 'from' and 'to' can be compared in business object forms. If 'from.id' is empty, the form has been reopened and an object has been loaded for the first time.
For newly created objects 'from.id < 1' applies.
Examples
With the help of the Calculate behaviour, comparisons and evaluations of the transferred 'from' and 'to' objects can be performed. The following scenarios can be covered with business objects (regardless of what actions are performed afterwards).
Comparison |
Check expression |
Message on 'true' |
from.id is equal to.id |
$cmp({from.id},==,{to.id}) |
The business object has been saved and reloaded into the form (e.g. custom action event with save action, or user presses 'Save'). |
from.id is emply |
$isEmpty({from.id}) |
This is the first time an object has been loaded into the form since it was opened ( Tip: To exclude empty data, you can also check to.id for not empty). |
from.id unequal to.id |
$cmp({from.id,!=,{to.id}) |
Another, already saved, business object was loaded (e.g. shipment 5121 and then shipment 5118). |
from.id is less than 1 |
$cmp({from.id},<,1) |
The business object was new and was now either saved or another business object was loaded (difficult to identify). |
to.id is less than 1 |
$cmp({to.id},<,1) |
A new business object, which has never been saved before, was loaded into the form (usually by clicking on the 'New' ribbon). |