最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

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

网络文摘 alirazazaidi 333浏览 0评论

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/

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址