1
votes

I created a query in the AOT (and open it with a View).

I want to set the queryRange in my Query object from code . In my init method I used this code :

Query q = new Query();
QueryRun qr;
QueryBuildDataSource qbds;

qbds = q.addDataSource(tableNum(MyTable));
qbds.addRange(fieldNum(MyTable, MyField)).value(SysQuery::valueUnlimited() ) ;
qr = new QueryRun (q) ;

But when I launch a View I don't see this query, the promt only shows the query with index-field. It's possible to set the range from code ?

1
You miss understand query is different from jquery - Sudharsan S
Thanks JqueryKing for your comment, then I can't to open query with the precompiled parameters range and choose the criteria? I know to set the range from Range node, but I would like to set the promt. greetings! - ulisses

1 Answers

4
votes

Instead of creating new query, use objects query:

public void init()
{
    super();
    query.dataSourceNo(1).addRange(fieldNum(MyTable, MyField)).value(SysQuery::valueUnlimited());
}