I have an app that creates pdfs of orders and contains child records. However, sometimes the child records are not recorded on the pdf.
On the template I use a Start End Expression.
How does this ensures all child records has been added ? Still I could not get the logic.
Do this as follows:
The child table must contain a Ref field to the parent table. Enable the Is a part of? property of the Ref field. This makes it possible to add child records when the parent record is added.
Add a Text field to the parent table. Call the field Status and set its Initial value property to "" (blank). The Status column controls whether the data change event triggers.
Create a data-change action for the parent table which sets the Status column’s value to "Run".
Create a second data-change action for the parent table which sets the Status column’s value to "" (blank).
Create a composite action for the parent table that invokes the two data-change actions above. This composite action invokes the first data-change action to set the Status column’s value to "Run", and the second data-change action to set the Status column’s value to blank. These two data changes will be sent to the server as separate updates. The first update triggers the automation event, while the second update prevents further updates from triggering the automation event.
Go to the UX > Views tab. Click Show system views. Select the form for the parent table. Expand Behavior. Find Event Actions and set its Form Saved property to the compositive action created in the previous step.
Set your data change event to Updates only. Set its Condition property to: [Status] = "Run"