private void AFZLookupDimension(FormStringControl _formStringControl, Name _dimensionName)
{
DimensionAttribute DimensionAttribute = DimensionAttribute::findByName(_dimensionName);
Query query = new Query();
QueryBuildDataSource qbdsFinancialTag,qbdsDirCategory;
QueryBuildRange qbr;
SysTableLookup SysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag),_formStringControl);
qbdsFinancialTag = query.addDataSource(tableNum(DimensionFinancialTag));
qbdsFinancialTag.addOrderByField(fieldNum(DimensionFinancialTag,Value),SortOrder::Ascending);
qbdsDirCategory = qbdsFinancialTag.addDataSource(tableNum(DimensionAttributeDirCategory));
qbdsDirCategory.relations(false);
qbdsDirCategory.addLink(fieldNum(DimensionFinancialTag,FinancialTagCategory),fieldNum(DimensionAttributeDirCategory,DirCategory));
qbr = qbdsDirCategory.addRange(fieldNum(DimensionAttributeDirCategory,DimensionAttribute));
qbr.value(queryValue(DimensionAttribute.RecId));
SysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag,Value));
SysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag,Description));
SysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag,Value));
SysTableLookup.parmQuery(query);
SysTableLookup.performFormLookup();
}
No comments:
Post a Comment