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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.12.2011, 01:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
sumitsaxfactor: Defaulting Ledger Dimensions [AX 2012]
Источник: http://sumitsaxfactor.wordpress.com/...sions-ax-2012/
==============

In my earlier post, I had described a way to default financial dimensions through code. In this post, I will describe about the way we can default Ledger Dimensions (DimensionAttributeValueCombination) through code.

We have seen how we can fetch the values from a dimension combination in my post here. But what if we have to default them using code.

Say you are creating a general journal and want to default the Account and Offset account fields. These fields have been changed to segmented controls and now store RecIds for DimensionAttributeValueCombination table.

The job below will help you in doing that.

Below are the screen shots of dimensions for the two record ids used below:





staticvoid setLedgerDimensions(Args _args)

{

    LedgerDimensionAccount  ledgerDimension; // Record id for LedgerDimension(DimensionAttributeValueCombination) containing combination of dimensions

    LedgerDimensionAccount  mainAccDimension; // Record id for LedgerDimension(DimensionAttributeValueCombination) containing default account for main account RecId

   

    RefRecId    emplDimAttrRecId = 5637147951; // For ex. purpose defaulting it to required DimensionAttributeValueSet RecordId

    RefRecId    dimensionRecId = 5637145941; // For ex. purpose defaulting it to required DimensionAttributeValueSet RecordId

    ;

    /*

     * For information on finding the record ids for required dimension combinations

     * Go through the following blog

     * http://sumitsaxfactor.wordpress.com/2011/12/28/defaulting-financial-dimensions-ax-2012/

     */

   

    // Get the default account for main account 110154

    mainAccDimension = DimensionStorage::getDefaultAccountForMainAccountNum("110154");

   

    //Find or create the LedgerDimension record for required combination

    //Param1 – Ledger Dimension record id, in our case Default account for main account

    //Param2 – Default Dimension Record Id for 1st Dimension Combination

    //Param3 – Default Dimension Record Id for 2nd Dimension Combination

    //Param4 – Default Dimension Record Id for 3rd Dimension Combination

    ledgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(

                                                            mainAccDimension,

                                                            dimensionRecId,

                                                            emplDimAttrRecId);

 

    info(strFmt("%1: %2", ledgerDimension, DimensionAttributeValueCombination::find(ledgerDimension).DisplayValue));

}



This is the output








Источник: http://sumitsaxfactor.wordpress.com/...sions-ax-2012/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
sumitsaxfactor: Defaulting Financial Dimensions [AX 2012] Blog bot DAX Blogs 0 28.12.2011 19:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
dynamics-ax: Interview with Microsoft's Lachlan Cash on his new role, AX 2012 and more Blog bot DAX Blogs 6 22.04.2011 14:55
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:46.