如何基于具有动态范围的查询刷新/同步视图? [英] How to refresh/Synch View based on a Query with dynamic range?

查看:109
本文介绍了如何基于具有动态范围的查询刷新/同步视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 Query 的简单 View ,我的自定义 Query 具有动态范围.

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

在类SysQueryRangeUtil中,我插入了一个自定义的 public static 方法,并将其复制到我的自定义查询"中. 这个范围,效果很好.但是我有一个问题,当范围条件发生变化时,如果我想查看新视图(具有新选择的记录),我必须在AOT的视图中进行同步.

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.

但是此操作无法执行简单的SystemUser.

But this operation can't do a simple SystemUser.

有一种方法可以在 View 中使用动态范围,而不是不断进行同步?

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

当更改打开表单/视图的用户必须更改显示的记录时,我的动态范围与curUserId()有关.如果我想看到差异,我必须每次都同步,但是对我来说这不是一个可行的解决方案.

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

谢谢!

推荐答案

不要在查询中使用范围,请在表单级别上移动此逻辑.

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

在表单的classDeclaration方法中声明一个QueryBuildRange类型的变量.

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

在表单数据源上覆盖init方法:

Override init method on your form datasource:

public void init()
{
    ;

    super();

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

在表单数据源上覆盖executeQuery方法:

Override executeQuery method on your form datasource:

public void executeQuery()
{
    ;

    queryRange.value(filterBycurUserId());

    super();
}

这篇关于如何基于具有动态范围的查询刷新/同步视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆