How do I update / sync a view based on a dynamic range query?
I have a simple view with a query, my custom query has a dynamic range.
In the class, SysQueryRangeUtil
I applied my own public static method and copied it into my custom request. This range works well. But I have a problem where the range conditions change, if I want to see a new view (with a new record selected), I have to sync in AOT my View.
But this operation cannot make a simple SystemUser.
Is there a way to use dynamic range in a view and not keep in sync?
My dynamic range refers to curUserId()
when changing the user who opens the form / view view should change the displayed record. If I want to see the difference, I have to sync every time, but this is not an acceptable solution for me.
Thanks everyone!
source to share
Don't use a range as you requested, move this logic to the form level.
In classDeclaration
your form method, declare a variable of type QueryBuildRange
.
Override method init
on your form data source:
public void init()
{
;
super();
queryRange = Table1_ds.query().addRange(MyView_ds.queryBuildDataSource(), AccountNum);
queryRange.status(RangeStatus::Hidden);
}
Override method executeQuery
on your form data source:
public void executeQuery()
{
;
queryRange.value(filterBycurUserId());
super();
}
source to share