This post is machine-translated. The original post in german language can be found here.

Filter a FormdataSource by financial dimensions

If you only want to display data records of a table that contain certain financial dimensions in a form, you can do this by overwriting the init() of the FormDataSource as follows:

public void init()
{
    super();
    
    SysQuery::addDimensionAttributeRange(salesTable_ds.query(),
                        salesTable_ds.name(),
                        fieldStr(Salestable, DefaultDimension),
                        DimensionComponent::DimensionAttribute,
                        '1001',
                        'CostCenter');    
}

You can also call addDimensionAttributeRange() multiple times, so you can filter for multiple dimensions simultaneously.

clearDimensionRangesFromQuery() removes such filters:

SysQuery::clearDimensionRangesFromQuery(salesTable_ds.query())

 

These post applies to following version:
Dynamics AX 2012

Add comment
 
 

 

This post is part of the series »Dynamics AX 2012 - Financial dimensions«

In Dynamics AX 2012, the handling of financial dimensions has changed. Both on the surface and the underlying data model.

In earlier versions you find one field - usually named dimension - of type array. Now you'll find a field derived from RecId called DefaultDimension (or similar).

In this series I want to specifically address these changes and present one or the other piece of code.

Show all posts from this series

RSS-Feed of this blog series


 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.