Тема
:
sumitsaxfactor: Find Active Dimensions for a Legal Entity [Ax2012]
Показать сообщение отдельно
14.12.2011, 04:27
#
1
Blog bot
Участник
25,643
/
848
(
80
)
Регистрация: 28.10.2006
sumitsaxfactor: Find Active Dimensions for a Legal Entity [Ax2012]
Источник:
http://sumitsaxfactor.wordpress.com/...entity-ax2012/
==============
This article focuses on getting the active dimensions for a Legal Entity. In Ax 2009, we could get the number of dimensions by using the enumCnt method on SysDimension enum and get the count. Here it is not that straight forward.
Following job will help you in getting the count and display their names;
static
void
getActiveFinancialDimensions(Args _args)
{
DimensionAttributeSetItem dimAttrSetItem;
// Contains the number of dimensions active for a account structure ledger
DimensionAttribute dimAttr;
// Contains the financial dimensions records
DimensionEnumeration dimensionSetId;
//Record id for table that contains active dimensions for current ledger
int
dimAttrCount;
//Get the record Id (dimension set id) for current ledger to find active dimensions
dimensionSetId = DimensionCache::getDimensionAttributeSetForLedger();
//Find the count of active dimensions for current ledger except main account
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));
//Find all the active dimensions for current ledger except main account and display them
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);
}
}
Источник:
http://sumitsaxfactor.wordpress.com/...entity-ax2012/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите
личное сообщение
администратору.
Blog bot
Посмотреть профиль
Найти ещё сообщения от Blog bot