The research, reread, and refresh methods are used to update the data displayed in a form in D365FO.
- Research reruns the existing form query against the database, therefore updating the list with new/removed records as well as updating all existing rows.
- Reread queries the database and re-reads the current record contents into the datasource form cache. This does not update the form controls, so you need to call refresh() after reread() to update the form controls.
- Refresh refreshes the data displayed in the form controls with whatever is stored in the form cache for that particular datasource record.
Here is a table that summarizes the differences between these methods:
| Method | Description |
|---|---|
| Research | Reruns the existing form query against the database, updating the list with new/removed records as well as updating all existing rows. |
| Reread | Queries the database and re-reads the current record contents into the datasource form cache. Does not update the form controls. |
| Refresh | Refreshes the data displayed in the form controls with whatever is stored in the form cache for that particular datasource record. |
Here is an example of how to use these methods:
Code snippet
// Assume that the current form has a data source named "MyDataSource".
// Update the database with some changes to the current record.
MyDataSource.update();
// Reread the current record from the database.
MyDataSource.reread();
// Refresh the form controls to show the updated record.
MyDataSource.refresh();
I hope this helps! Let me know if you have any other questions.
Comments
Post a Comment