Hello…
I created a view and added it to standard form
there is no relation in table InventTable with view , so i need to create it in the form data source InventTable
the relation will be MyView.product and inventTable.Product
[ExtensionOf(formDataSourceStr(PriceDiscTable, InventTable))]
final class zz_PriceDiscTable_Form_init_AddFields_Extension
{
public void init()
{
next init();
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = this.query().dataSourceTable(tableNum(InventTable));
queryBuildDataSource.addDataSource(tableNum(zz_ProductCategory));
queryBuildDataSource.relations(false);
queryBuildDataSource.addLink(fieldnum(zz_ProductCategory, Product),fieldnum(InventTable, Product));
queryBuildDataSource.joinMode(JoinMode::OuterJoin);
}
}
also test next but give me : data source is not embedded within a (parent) data source.
[ExtensionOf(formDataSourceStr(PriceDiscTable, zz_ProductCategory))]
final class zz_PriceDiscTable_Form_init_AddFields_Extension
{
public void init()
{
next init();
this.queryBuildDataSource().relations(false);
this.queryBuildDataSource().addLink(fieldNum(InventTable, Product),
fieldNum(zz_ProductCategory, Product));
}
}
when build and test there is no duplication on form but no data displayed from the view in grid
Thanks all