datasource did not work properly after add groupby

I have a problem with addGroupByField methods of data sources.

I have a data source that query TableA innerJoin InventDim by inventDimId,

but if I group TableA’s columns, then the fields of inventDim table is not show on the grid of the form.

this is my override method of

public void executeQuery() { //of data source (TableA) {

this.query().clearGroupBy();

qbds = this.query().dataSourceName(“TableA”);

qbds.addGroupByField(fieldNum(TableA, BatchNo));
qbds.addGroupByField(fieldNum(TableA, PalletNo));
qbds.addGroupByField(fieldNum(TableA, SiteId));

super();

}

but once I remove those 3 lines of addGroupByField, the fields of InventDim correctly show data in InventDim.

I was wondering if there is any thing wrong on my code?

many thanks.

Vincent

It works correctly. If you use grouping, the only fields with values are:

  1. Those you group by
  2. Aggregated fields

You code doesn’t show any grouping nor aggregation of fields from InventDim table, therefore no field from InventDim has any defined value.

Martin is right, the fields in InventDim won’t show up, unless they are also grouped or aggregated, but in this case, you probably don’t want to do that either.

Hi Martin,
thanks. actually I got help from your other posts very often. Thank you so much.

Thanks Kwen too!