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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.09.2012, 20:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
ax-erp: How to use default dimensions as Dialog fields in dialogs [Dynamics AX 2012]
Источник: http://microsoft-dynamics-ax-erp.blo...as-dialog.html
==============


Friends,
This post will help you how to add default dimensions as dialog fields on the dialogs in AX 2012.
There is a new class that has been introduced in AX 2012 by name DialogFieldDimensionDefaultingController to handle this.
This class has been used in very few places in standard AX 2012 and is little tricky to pick the relevant code.
So this post will be handy for all developers at least at high level to get the default dimensions as dialog fields.
Below is the dialog with the default dimensions as dialog fields.

Code walkthrough:
Create a new class and methods as shown below one by one
class SR_DimensionDialog extends RunBase
{


#DimensionDefaultingFieldSetElements
DimensionAttributeValueSetStorage dimAttrValueSetStorage;


DialogFieldDimensionDefaultingController dfDimDefaultingControllerChecksAndValues;
DimensionDefaultingFieldSet dimensions;


Dialog dialog;

#DEFINE.CurrentVersion(1)
#LOCALMACRO.CurrentList
dimensions
#ENDMACRO
}



Object dialog()
{
dialog = super();
dialog.caption("DialogFieldDimensionDefaultingController example");
dfDimDefaultingControllerChecksAndValues = dialog.addDimensionDefaultingController();


//dfDimDefaultingControllerChecksAndValues.initWithChecksAndValues(false, false, false, true, 0, "Dimensions as dialog fields example", "@SYS104593");
dfDimDefaultingControllerChecksAndValues.initWithValues(false,false,true,0,"Dimension – dialog fields");


return dialog;
}


boolean getFromDialog()
{
dfDimDefaultingControllerChecksAndValues.save();
dimensions = dfDimDefaultingControllerChecksAndValues.value();


returnsuper();
}

publiccontainer pack()
{
;
return [#CurrentVersion, #CurrentList];
}

void run()
{


// dimAttrValueSetStorage = DimensionAttributeValueSetStorage::find(Dimensions[#DimDefaultingFieldSet_AttrValueSetId]);
}

publicboolean unpack(container packedClass)
{
boolean ret = false;
Version version = RunBase::getVersion(packedClass);


switch (version)
{
case #CurrentVersion:
[version, #CurrentList] = packedClass;
ret = true;
break;
}
return ret;
}

staticvoid main(Args args)
{


SR_DefaultDimensionsDialog sr_DefaultDimensionsDialog;


sr_DefaultDimensionsDialog = new SR_DefaultDimensionsDialog();


if (SR_DefaultDimensionsDialog.prompt())
{
SR_DefaultDimensionsDialog.run();
}
}


Some more methods you can try in the DialogFieldDimensionDefaultingController class are shown below.
I have used initWithValues as I am interested in only capturing the dialog values.



If you use InitWithChecksAndValues method, your dialog looks like below


However you need to write additional code to make it work though.


Explore the other methods based on your requirements.


That’s all for now.



Источник: http://microsoft-dynamics-ax-erp.blo...as-dialog.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX Sustained Engineering: Servicing of Dynamics AX 2012 and Dynamics AX 2012 Feature Pack Blog bot DAX Blogs 0 08.05.2012 23:12
axnontechnical: How to modify default cubes in Microsoft Dynamics AX 2012 Blog bot DAX Blogs 0 07.03.2012 02:19
dynamics-ax: A Guide to Microsft Dynamics Cloud ERP - Dynamics AX Blog bot DAX Blogs 0 15.04.2011 00:12
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
emeadaxsupport: How to add financial dimension to Dynamics AX Default cubes Blog bot DAX Blogs 0 13.01.2011 16:11

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

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

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