In the Part 1, we saw how to use caller.args() to refresh the caller DataSource.
This Post explains how caller Dataset is set.
I have a Form Form1 which has 2 Datasets, Table1 and Table2.
Table1 is my main Data Source. Table2 is the child Data Source.
I have an another Form Form2. This has been added as a menu Item button on Form1.
The reason is, I will Open Form2 from Form1. This way I can check the caller Dataset of Form1.
Field1, Field2 belong to Table1 and Field3, Field4 belong to Table2.
Table1.Field2 == Table2.Field3.
On the Form2 Init method, I have the below code.
Now, we have a few scenarios
- I open the Form2 from the display menu Item button in Form1.
The Data Source is 'Table1'. The reason is Table1 is the first Data Source of Form1.
If I assign Data Source property of the ActionPane/ButtonGroup/MenuItem, The DataSet will be the assigned Data Source of these Objects.
Priority will be given to the object at the lower level.
i.e.
- If ActionPane Data Source is Table2 and the other objects do not have this property set, the caller Dataset is Table2. This overrides the first Data Source of the Form.
- If the ActionPane Data Source is Table2 and menuItem Data Source is Table1, the caller Dataset is Table1. This overrides the first Data Source of the Form and the Data Source mentioned in ActionPane/ButtonGroup.
Comments
Post a Comment