Here find the GitHub Example
public class InventTestItemQualityGroup
{
[FormDataSourceEventHandler(formDataSourceStr(InventTestItemQualityGroup, InventTestItemQualityGroup), FormDataSourceEventType::Initialized)]
public static void InventTestItemQualityGroup_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
{
var overrides = InventTestItemQualityGroup::construct();
sender.object(fieldNum(InventTestItemQualityGroup, HHDFinishedGoods)).registerOverrideMethod(methodStr(FormDataObject, lookup),
methodStr(InventTestItemQualityGroup,ItemId_OnLookup), overrides);
}
public void ItemId_OnLookup(FormStringControl _callingControl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable), _callingControl);
Query query = new Query();
QueryBuildDataSource qbds,qbds2;
QueryBuildLink queryBuildLink;
qbds= query.addDataSource(tableNum(InventTable));
qbds.addRange(fieldNum(InventTable, ItemId));
qbds2 = qbds.addDataSource(tablenum(InventItemGroupItem));
qbds2.joinMode(JoinMode::InnerJoin);//
qbds2.addLink(fieldnum(InventTable, ItemId),fieldnum(InventItemGroupItem, ItemId));//
qbds2.addLink(fieldNum(InventTable, DataAreaId),fieldnum(InventItemGroupItem, ItemDataAreaId));//
qbds2.addRange( fieldNum( InventItemGroupItem, ItemGroupId)).value(queryValue(InventParameters::find().HHDItemGroup));
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield(fieldNum(InventTable, ItemId));
sysTableLookup.addLookupfield(fieldNum(InventTable, NameAlias));
sysTableLookup.addLookupfield(fieldNum( InventItemGroupItem, ItemGroupId));
sysTableLookup.performFormLookup();
}
public static InventTestItemQualityGroup construct()
{
return new InventTestItemQualityGroup();
}
}
public class InventTestItemQualityGroup
{
[FormDataSourceEventHandler(formDataSourceStr(InventTestItemQualityGroup, InventTestItemQualityGroup), FormDataSourceEventType::Initialized)]
public static void InventTestItemQualityGroup_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
{
var overrides = InventTestItemQualityGroup::construct();
sender.object(fieldNum(InventTestItemQualityGroup, HHDFinishedGoods)).registerOverrideMethod(methodStr(FormDataObject, lookup),
methodStr(InventTestItemQualityGroup,ItemId_OnLookup), overrides);
}
public void ItemId_OnLookup(FormStringControl _callingControl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable), _callingControl);
Query query = new Query();
QueryBuildDataSource qbds,qbds2;
QueryBuildLink queryBuildLink;
qbds= query.addDataSource(tableNum(InventTable));
qbds.addRange(fieldNum(InventTable, ItemId));
qbds2 = qbds.addDataSource(tablenum(InventItemGroupItem));
qbds2.joinMode(JoinMode::InnerJoin);//
qbds2.addLink(fieldnum(InventTable, ItemId),fieldnum(InventItemGroupItem, ItemId));//
qbds2.addLink(fieldNum(InventTable, DataAreaId),fieldnum(InventItemGroupItem, ItemDataAreaId));//
qbds2.addRange( fieldNum( InventItemGroupItem, ItemGroupId)).value(queryValue(InventParameters::find().HHDItemGroup));
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield(fieldNum(InventTable, ItemId));
sysTableLookup.addLookupfield(fieldNum(InventTable, NameAlias));
sysTableLookup.addLookupfield(fieldNum( InventItemGroupItem, ItemGroupId));
sysTableLookup.performFormLookup();
}
public static InventTestItemQualityGroup construct()
{
return new InventTestItemQualityGroup();
}
}
No comments:
Post a Comment
Give me the commetns and solutions