I'm currently working with a form that has a grid at the bottom. Whenever I hit f5, the grid refreshes, but the rest of the form does not. What can I do to make the entire form refresh it's data?
Thanks.
To refresh the parent form, open the form you use to call the dialog or drop dialog form where you added the previous code. Select a record, open the dialog form, and make a change to a field that appears on the parent form. Click OK to close the dialog form.
Right-click the Methods node under the data source, point to Override Method, and then click refresh.
You may override the research
method on a datasource:
public void research(boolean _retainPosition = false)
{
super(_retainPosition);
other_ds.research(_retainPosition);
}
The other_ds
is a datasource not joined by the current datasource.
It depends on the form you are working with. When you hit F5 on a record, it runs the research
method on the datasource the record belongs to or its parent datasource (depends on the form's query, e.g. if you hit F5 on SalesLine in the SalesTable form, SalesTable_ds.research(true)
will be run). As I see it, if the rest of your form displays fields that belong to these datasources then these fields will be updated. If the fields do not belong to these datasource the rest of your form will not be updated (unless e.g. the active
method has been overridden to refresh the rest of the form from the code.
What you can do to make the entire form refresh its data when F5 is hit: again, it depends on the form, so not knowing all the details it is difficult to advise something, but one of the things you can do is override the research
method on your datasource and refresh the rest of the form programatically from there. It is more common to override the active
method, you should normally go for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With