Hi all
I'm having trouble getting all the ranges from a Query object.
This is what i have in the screen:

This is what i have in code:
private str CreateQueryFiltersLine(Query _query)
{
QueryBuildDataSource qbd, joinedQbd;
QueryBuildRange queryRange;
int dsCount, i, rangeCount, y;
str result;
str blob;
dsCount = _query.dataSourceCount();
for (i = 1 ; i <= dsCount; i++)
{
qbd = _query.dataSourceNo(i);
rangeCount = qbd.rangeCount();
for (y = 1 ; y <= rangeCount; y++)
{
queryRange = qbd.range(y);
result += strFmt('%1: %2\n', queryRange.fieldName(), queryRange.value());
}
if (qbd.joined())
{
blob = BinData::dataToString(qbd.joinedDataSources());
}
}
return result;
}
Looping gives me these objects in the debugger.
First datasource:

Second datasource:

Looping over the datasets gives me only 1 range for the second data source
The problem is that i'm only getting the first range (the billable line one) from the screen. Not the second.
I believe this is due to the fact that the second filter is on a joined data source (of the first datasource).
However, im not sure how to cast the blob im getting from the qbd.joinedDataSources() call.
Any ideas would be appreciated.