问题
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