How to refresh/Synch View based on a Query with dynamic range?

和自甴很熟 提交于 2019-12-25 05:36:14

问题


I have a simple View with a Query , my custom Query has a Dynamically Range.

In class SysQueryRangeUtil I have insered a my custom public static method and copy it in my Custom Query. This range, work well. But I have a problem, when the range condition change, if I want to see the new view(with new selected record) I have to Synch, in AOT my View.

But this operation can't do a simple SystemUser.

There is a way to use a dynamic range in a View and not constantly synchronize ?

My dynamic range relates to curUserId() when change the user who open the Form/View the view has to change the record displayed. If I want to see de difference I have to synch every time, but for me it's not an usable solution.

MyView

Thanks all!


回答1:


Do not use range on your query, move this logic on form level.

In the classDeclaration method of your form declare a variable of type QueryBuildRange.

Override init method on your form datasource:

public void init()
{
    ;

    super();

    queryRange = Table1_ds.query().addRange(MyView_ds.queryBuildDataSource(), AccountNum);
    queryRange.status(RangeStatus::Hidden);
}

Override executeQuery method on your form datasource:

public void executeQuery()
{
    ;

    queryRange.value(filterBycurUserId());

    super();
}


来源:https://stackoverflow.com/questions/42549908/how-to-refresh-synch-view-based-on-a-query-with-dynamic-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!