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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Getting All Active financial dimensions in D365 for Finance and operations (AX 7)

Ali Zaidi Profile Picture Ali Zaidi 4,657

Testing the old code in Dynamics 365 for Finance and operations. It works fine. If you try to get all active financial dimension in D365 for Finance and operations following code snippet works perfectly fine.

class TestReadFinanicalDimension
{
///

/// Runs the class with the specified arguments.
///

/// The specified arguments. public static void main(Args _args)
{
DimensionAttributeSetItem dimAttrItemSet;
DimensionAttribute dimAttrList;
DimensionEnumeration dimensionSetId;

int dimAttrCount;

dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();

select count(RecId) from dimAttr
where dimAttr.Type != DimensionAttributeType::MainAccount
join RecId from dimAttrSetItem
where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
dimAttrSetItem.DimensionAttributeSet == dimensionSetId;

info(strFmt(“Total active financial dimensions for current legal entity: %1”, dimAttr.RecId));

while select * from dimAttr
order by Name
where dimAttr.Type != DimensionAttributeType::MainAccount
join RecId from dimAttrSetItem
where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&
dimAttrSetItem.DimensionAttributeSet == dimensionSetId
{
info(dimAttr.Name);
}

}

}

Output is


Reference: https://sumitsaxfactor.wordpress.com/2011/12/14/find-active-dimensions-for-a-legal-entity-ax2012/

Comments

*This post is locked for comments