Let's say I have Item Group IG001
And two Major Groups MG001 and MG002
IG001 and MG001 use Item Template IT001
/// <summary>
///
/// </summary>
public void modified()
{
AMInventItemTemplate amInventItemTemplate;
super();
//Create a new query
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
QueryRun qr;
//Specify the name of the table the lookup should show data from.
queryBuildDataSource = query.addDataSource(tableNum(AMInventItemTemplate));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(AMInventItemTemplate,TemplateId));
queryBuildRange.value(queryValue(TCI_ItemTable.TemplateNumber));
qr = new QueryRun(query);
while (qr.next())
{
amInventItemTemplate = qr.get(tablenum(AMInventItemTemplate));
TCI_ItemTable.CoverageGroup = amInventItemTemplate.ReqGroupId;
TCI_ItemTable.InventorySite = amInventItemTemplate.InventSiteId;
TCI_ItemTable.Phantom = amInventItemTemplate.Phantom;
}
}
public boolean modified()
{
boolean ret;
AMInventItemMajorGroup amInventItemMajorGroup;
ret = super();
TCI_ItemTable.TemplateNumber = '';
TCI_ItemTable.MinorGroup = '';
TCI_ItemTable.CoverageGroup = '';
TCI_ItemTable.InventorySite = '';
TCI_ItemTable.Phantom = NoYes::No;
//Create a new query
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange, queryBuildRange2;
QueryRun qr;
//Specify the name of the table the lookup should show data from.
queryBuildDataSource = query.addDataSource(tableNum(AMInventItemMajorGroup));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(AMInventItemMajorGroup,MajorGroupId));
queryBuildRange.value(queryValue(TCI_ItemTable.MajorGroup));
queryBuildRange2 = queryBuildDataSource.addRange(fieldNum(AMInventItemMajorGroup,ItemGroupId));
queryBuildRange2.value(queryValue(TCI_ItemTable.ItemGroup));
qr = new QueryRun(query);
while (qr.next())
{
amInventItemMajorGroup = qr.get(tablenum(AMInventItemMajorGroup));
TCI_ItemTable.TemplateNumber = amInventItemMajorGroup.ItemTemplateId;
}
TCI_ItemTable_ds.object(fieldNum(TCI_ItemTable, TemplateNumber)).modified();
return ret;
}
}
public boolean modified()
{
boolean ret;
AMInventItemMajorGroup amInventItemMajorGroup;
ret = super();
TCI_ItemTable.TemplateNumber = '';
//element.redraw();
//TCI_ItemTable.MinorGroup = '';
//TCI_ItemTable.CoverageGroup = '';
//TCI_ItemTable.InventorySite = '';
//TCI_ItemTable.Phantom = NoYes::No;
//Create a new query
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange, queryBuildRange2;
QueryRun qr;
//Specify the name of the table the lookup should show data from.
queryBuildDataSource = query.addDataSource(tableNum(AMInventItemMajorGroup));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(AMInventItemMajorGroup,MajorGroupId));
queryBuildRange.value(queryValue(TCI_ItemTable.MajorGroup));
queryBuildRange2 = queryBuildDataSource.addRange(fieldNum(AMInventItemMajorGroup,ItemGroupId));
queryBuildRange2.value(queryValue(TCI_ItemTable.ItemGroup));
qr = new QueryRun(query);
while (qr.next())
{
amInventItemMajorGroup = qr.get(tablenum(AMInventItemMajorGroup));
TCI_ItemTable.TemplateNumber = amInventItemMajorGroup.ItemTemplateId;
}
//TCI_ItemTable_TemplateNumber.modified();
return ret;
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156