Financial Dimension Dialog Filter and Query Range using Data Provider in AX reporting

Hi there,

I am new to AX 2012(R3). Can anyone please help me in one of my requirement. I have made a dialog filter using Dialogfield and providing a multiselect for selecting a Division Financial dimension from CustInvoiceJourn table.

I want to iterate through the selected values and filter the results as per the selection in the Report data provider class, but i am not able to get the dimensions as the default dimension does not match to the selected values. below is the code i am using:

custListIterator = new ListIterator(contract.parmCustAccountList());
query = new Query(queryStr(MEKCustTable));
qbdsCustTable = query.dataSourceTable(tableNum(CustInvoiceJour));

while(custListIterator.more())
{
qbdsCustTable.addRange(fieldNum(CustInvoiceJour, DefaultDimension)).value(custListIterator.value());

custListIterator.next();
}

can anyone please help.

Thanks

What is inside custAccountList()? If it’s a list of customer account numbers, then the range doesn’t make sense, because IDs of default dimensions and customer account numbers are different things.

Hi Martin
The custAccountList is supposed to be a list of user selected list of division dimension. The issue is i am not able to add these to the query range as i am not sure how to specify dimension in a range. I have a dimension “Division” and i want to select all retail and trade division customer invoices. Any ideas??

Thanks

Division is a dimension attribute and you should be applying range on the attribute.
Use the existing methods,
\Classes\DimensionProvider\addAttributeRangeToQuery
\Classes\DimensionProvider\addAttributeRangeToQueryFromRangeCon

Hi Kranthi

I am trying to use the class using below syntax and getting error “DictField not intialised”. can you please let me know where am i going wrong?

dimensionProvider.addAttributeRangeToQuery(
qr,
dsinvoiceTable.name(), // custinvoicejour
identifierStr(LedgerDimension), //not sure about this dimension
DimensionComponent::DimensionAttribute,
_division,
“Division”,
true);

identifierStr(LedgerDimension), //not sure about this dimension
It should be ‘DefaultDimension’