foundset.loadRecords doesn't load records

Hi, foundset.loadRecords doesn’t load records due to additional column in the sql. The additional column is created through an aggregate function.

Please see codes below:
001 var foundset = databaseManager.getFoundSet(DB_SERVER_NAME, TABLE_NAME);
002 var dataList = databaseManager.getDataSetByQuery(DB_SERVER_NAME, “SELECT *,AGG_FNCTN ADDTL_COLUMN FROM TABLE_NAME”, null, -1);
003 foundset.loadRecords(dataList);

Should this be working and load values in foundset?

thanks.

Erik,

foundset.loadRecords(dataSet) expects a data set of just the pk columns.
If you have more columns in the dataset the remaining are ignored, but the first columns have to match the pk columns in alphabetical order.

Rob

Thanks for the reply.

I solved the problem. The loadRecords method expects the first column to be the primary key of the table. The codes above will work just fine. But if I change line 002 with the one below, it will yield 0 records:

002 var dataList = databaseManager.getDataSetByQuery(DB_SERVER_NAME, “SELECT AGG_FNCTN ADDTL_COLUMN ,* FROM TABLE_NAME”, null, -1);