How to access the user specified ranges in a form i.e. the ranges set manually by the use, using right click ‘Filter by field / Filter by selection’ or using the advanced query button.

This is actually quite simple as shown in the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public void executeQuery()
{
    Query query;
    int i;
    ;
    super();
 
    query = this.queryRun().query();
 
    for (i = 1; i <= query.dataSourceNo(LedgerJournal).rangeCount(); i++)
    {
        info(strfmt("Campo: %1 ", fieldid2name(tableNum (LedgerJournal), query.dataSourceTable(tableNum(LedgerJournal)).range(i).field())));
        info(strfmt("Valor: %1", query.dataSourceTable(tableNum(LedgerJournal)).range(i).value()));
    }
}

O método executeQuery() é um metodo do DataSource.

[]s
Ricardo Pichler

Fonte.