I am using InventSite table to fetch unique SiteId and Name fields.
- Query query;
- QueryBuildDataSource qbds;
- QueryRun qr;
- InventSite inventSite;
- query = new Query();
- qbds = query.addDatasource(tablenum(InventSite));
- qbds.addGroupByField(fieldnum(InventSite, SiteId));
- qbds.addGroupByField(fieldnum(InventSite, Name));
- while(qr.next())
- {
- inventSite = qr.get(tablenum(InventSite));
- info(strfmt("SiteId : %1, Name : %2", inventSite.SiteId, inventSite.Name));
- }
Note: If I comment Step-9, in the result we wont get Name details
No comments:
Post a Comment