web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

X++ code to display description of financial dimensions for a given dimension in D365FO.

Chaitanya Golla Profile Picture Chaitanya Golla 17,225

Hi,

In this post will provide the code to display the description of financial dimensions for a given party. For demo purpose chosen a vendor.

Below are the financial dimensions of a vendor:

5483.VendorDimensions.jpg

X code:

class DAX_FindDimenDescDisplay
{        
    /// 
    /// Runs the class with the specified arguments.
    /// 
    /// The specified arguments.
    public static void main(Args _args)
    {   
        VendTable							vendTable;
        int									i = 1;
        DimensionAttribute					dimAttribute;
        DimensionAttributeValueSetItemView  dimAttrValueSetItemView;
        DimensionAttributeValue				dimAttributeValue;

        while select DefaultDimension from vendTable
            join DimensionAttributeValueSet, DimensionAttribute, AttributeValueRecId from dimAttrValueSetItemView
                where dimAttrValueSetItemView.DimensionAttributeValueSet == vendTable.DefaultDimension
                join recId, Name from dimAttribute
                    where dimAttribute.recId == dimAttrValueSetItemView.DimensionAttribute
                join dimAttributeValue
                    where dimAttributeValue.RecId == dimAttrValueSetItemView.AttributeValueRecId
					   && vendTable.AccountNum == "1001"
        {
            info(strFmt("Name: %1, Description: %2", dimAttribute.name, dimAttributeValue.getName()));
        }
    }

}

On executing the above code, dimension names and descriptions get displayed.

Output1.jpg

Regards,

Chaitanya Golla

Comments

*This post is locked for comments