In this article, giving an example for defining the lookup for dimensions in simple way.
This example will cover only for user Defined dimensions.
For this
1) Created a form and added two string controls.
2) Named as
Control: Name: Dimensionlist, Auto declaration – Yes
Control: Name: DimValues
3) Override the lookup method for Dimensionlist


We can use the same concepts for Dimension controls on Ax 2012 SSRS reports dialog. To build the report dialog UI with dimension controls.
Thanks to the content provider
http://community.dynamics.com/ax/b/axsantoshkumar/archive/2013/04/19/custom-lookup-for-dimensions-in-ax-2012-for-user-defined-dimensions.aspx
This example will cover only for user Defined dimensions.
For this
1) Created a form and added two string controls.
2) Named as
Control: Name: Dimensionlist, Auto declaration – Yes
Control: Name: DimValues
3) Override the lookup method for Dimensionlist
public void lookup()4) Override the lookup method for DimValues
{
Query query;
SysTableLookup sysTableLookup;
super();
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), this);
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));
query = new Query();
query.addDataSource(tableNum(DimensionAttribute)).
addRange(fieldNum(DimensionAttribute, Type)).
value(queryValue(DimensionAttributeType::CustomList));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
public void lookup()Run:
{
DimensionAttribute dimensionAttribute;
DimensionAttributeDirCategory dimAttributeDirCategory;
Query query = new Query();
SysTableLookup sysTableLookup;
dimensionAttribute = DimensionAttribute::findByName(Dimensionlist.text());
super();
// Only user defined dimensions will have a financial tag category
if (dimensionAttribute.Type == DimensionAttributeType::CustomList)
{
select firstonly DirCategory from dimAttributeDirCategory where dimAttributeDirCategory.DimensionAttribute == dimensionAttribute.RecId;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
// Add name field to be shown in the lookup form.
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();
}
}
We can use the same concepts for Dimension controls on Ax 2012 SSRS reports dialog. To build the report dialog UI with dimension controls.
Thanks to the content provider
http://community.dynamics.com/ax/b/axsantoshkumar/archive/2013/04/19/custom-lookup-for-dimensions-in-ax-2012-for-user-defined-dimensions.aspx
No comments:
Post a Comment