Here is the sample X++ code to create custom financial dimension lookup
public void Lookup(FormStringControl _control)
{
DimensionAttribute dimensionAttribute;
DimensionAttributeDirCategory dimAttributeDirCategory;
Query query = new Query();
SysTableLookup sysTableLookup;
dimensionAttribute = DimensionAttribute::findByName('ServiceLine');
if (dimensionAttribute.Type == DimensionAttributeType::CustomList)
{
select firstonly DirCategory from
dimAttributeDirCategory
where dimAttributeDirCategory.DimensionAttribute
== dimensionAttribute.RecId;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), _control);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value));
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
query = new Query();
query.addDataSource(tableNum(DimensionFinancialTag)).
addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)).
value(queryValue(dimAttributeDirCategory.DirCategory));
sysTableLookup.parmQuery(query);
//
Perform the lookup.
sysTableLookup.performFormLookup();
}
}
No comments:
Post a Comment