Classes : InventDimCtrl_Frm_OnHand
\Classes\InventDimCtrl_Frm_OnHand\modifyQueryBasedOnDatasourceName
\Classes\InventDimCtrl_Frm_OnHand\modifyQueryBasedOnDatasourceName
if (groupByNameAlias)
{
inventTableDataSource = query.dataSourceTable(tableNum(InventTable));
{
inventTableDataSource = query.dataSourceTable(tableNum(InventTable));
if (inventTableDataSource)
{ query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, NameAlias));
query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, PrimaryVendorId)); // Add your Fields here
}
}
{ query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, NameAlias));
query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, PrimaryVendorId)); // Add your Fields here
}
}
We can also Join Other Tables :
if (groupByNameAlias)
{
inventTableDataSource = query.dataSourceTable(tableNum(InventTable));
inventItemGroupItemDataSource = inventTableDataSource.addDataSource(tableNum(inventItemGroupItem));
inventItemGroupItemDataSource.relations(true);
EcoresProductDataSource = inventTableDataSource.addDataSource(tableNum(EcoresProduct));
EcoresProductDataSource.relations(true);
EcoResproductCategoryDataSource = EcoresProductDataSource.addDataSource(tableNum(EcoResproductCategory));
EcoResproductCategoryDataSource.relations(true);
EcoResCategoryDataSource = EcoResproductCategoryDataSource.addDataSource(tableNum(EcoResCategory));
EcoResCategoryDataSource.relations(true);
if (inventTableDataSource)
{
query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, NameAlias));
query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, Itembuyergroupid));
query.dataSourceTable(tableNum(InventTable)).addGroupByField(fieldNum(InventTable, PrimaryVendorId));
}
if(inventItemGroupItemDataSource)
{ query.dataSourceTable(tableNum(inventItemGroupItem)).addGroupByField(fieldNum(inventItemGroupItem, ItemGroupId))
}
if(EcoResCategoryDataSource)
{
query.dataSourceTable(tableNum(EcoResCategory)).addGroupByField(fieldNum(EcoResCategory, Name));
}
}