4 May 2015

Get Dimensions(Department) in SSRS Report + AX 2012

public Name GetDepartmentName (DimensionDefault _dimension)
{
      Name                                 displayName;
      DimensionAttributeValueSetItem      valueSetItem;
      DimensionAttribute                  dimAttribute;
      DimensionAttributeValue             dimAttributeValue;
      //CustInvoiceLine                        _custInvoiceLine;
      //CustInvoiceTable                       CustInvoiceTable;


     select DimensionAttributeValueSet from valueSetItem
            where valueSetItem.DimensionAttributeValueSet == _dimension
                    join RecId from dimAttributeValue
                        where valueSetItem.DimensionAttributeValue == dimAttributeValue.RecId
                            join RecId from dimAttribute
                                where dimAttributeValue.DimensionAttribute == dimAttribute.RecId
                                      && dimAttribute.Name == enum2str(sysdimension::Department);

     displayName = DimensionAttributeValue::find(dimAttributeValue.RecId).getName();
    return displayName;
}

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...