AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 17.06.2019, 15:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
erconsult: Get a cost center in D365FO
Источник: http://erconsult.eu/blog/get-a-cost-center-in-d365fo/
==============

It is shocking to see over and over again functional consultants failing to create the Cost center dimension backed by the Organization units table (Organisation administration > Organisations > Operating units), choosing a custom dimension type instead and loosing the ability to specify an address, make a hierarchy of cost centers, specify a cost center manager etc.

This has also given a rise to excruciatingly dumb custom code snippets predating the dimension name CostCenter as if there were no British English or other languages.

With the proper setup and the proper coding this reduces to 3 essential lines:

static void main(Args _args)
{
DefaultDimensionView defaultDimensionView;
RefRecId testDefaultDimensionRecId =
(select firstonly DefaultDimension from ProdTable where ProdTable.ProdId == "P000173").DefaultDimension;
// Copy of the private method OMOperatingUnit::getDimensionViewId()
RefTableId getDimensionViewId(OMOperatingUnitType _omOperatingUnitType)
{
Dictionary dict = new Dictionary();
DictEnum dictEnum = new DictEnum(enumNum(OMOperatingUnitType));
return dict.tableName2Id(strFmt('DimAttribute%1', dictEnum.index2Symbol(_omOperatingUnitType)));
}


// Filter by the virtual backing entity table Id for cost centers
select defaultDimensionView
where defaultDimensionView.BackingEntityType == getDimensionViewId(OMOperatingUnitType::OMCostCenter)
&& defaultDimensionView.DefaultDimension == testDefaultDimensionRecId;

info(defaultDimensionView.DisplayValue);
}


The post Get a cost center in D365FO appeared first on ER-Consult.



Источник: http://erconsult.eu/blog/get-a-cost-center-in-d365fo/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
powerobjects: Cost Accounting Module in Dynamics 365 for Finance and Operations Blog bot Dynamics CRM: Blogs 0 24.07.2018 02:41
dynamicsax-fico: Cost accounting (16) Blog bot DAX Blogs 0 19.11.2017 14:11
dynamicsax-fico: Cost accounting (6) Blog bot DAX Blogs 0 13.08.2017 14:20
dynamics-coe: “Cost accounting” for multi-level process manufacturing Blog bot DAX Blogs 0 11.02.2016 22:12
NAV Team: Simulation of Average Cost Calculation Blog bot Dynamics CRM: Blogs 0 13.01.2012 16:54

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:36.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.