DYNAMICS 365中 datasource 的refresh(), reread(), research()的作用

n X++ we have the below methods for fetching data after any changes are made, below is the short description of what they are and when to use each one.

Refresh() refreshes the user view with whats stored in the caches. This does not touch the DB.
Use this after any form change has been made through code.

ReRead() fetches only the current record from database and does not re read the complete datasource.
Use this when you need to update only the current record after modifying any value.

ReSearch() will execute the same query again and fetch the results from the database.
Use this if you need to get the current most data from database.

ExecuteQuery() will run the query again just like research does but it will also take any query changes into account.
Use this is you have modified the query on run-time and need the updated results according to the new query.

例如, 后台数据更新后,只想重新加载当前这条记录的缓冲并刷新它相关的UI view,则需要用reread()& refresh().

        sender.formRun().dataSource("ds_master").reread();
        sender.formRun().dataSource("ds_master").refresh();
 

猜你喜欢

转载自blog.csdn.net/rocklee/article/details/81805731