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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.10.2012, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
ax-erp: Save the users last values in a dialog.
Источник: http://microsoft-dynamics-ax-erp.blo...in-dialog.html
==============

Had a case then I needed to do a modification to a report with a custom dialog where the user could make som changes to the information that teh report would show.

I needed the same behavioure as you get from a RunBase class but I needed to use it in a report. Tha solution was to use the xSysLastValue class.
client server public static container getValue(CompanyId _company,
userId _userId, UtilElementType _type, identifiername _elementName
[, identifiername _designName])
The usage is pretty simple, the parameters is used to identify the correct data. One thing to remember is that if you use this method to retrieve the user data for a dialog in a report for example don't use the reports name as _elementName because you can end up with the user data for the report instead.

To save the data you use the:
client server public static void putValue(container _value, CompanyId _company,
userId _userId, UtilElementType _type, identifiername _elementName
[, identifiername _designName])
Example:

static void SaveLastValues(Args _args)
{
Dialog _dlg;
DialogGroup _dlgGroup;
DialogField _dlgField1;
DialogField _dlgField2;
container _dialogValues;
NoYesId _choice1;
NoYesId _choice2;
;

_dlg = new dialog();

_dlgGroup = _dlg.addGroup("Group");
_dlgField1 = _dlg.addField(typeid(NoYesId),"Choice 1");
_dlgField2 = _dlg.addField(typeid(NoYesId),"Choice 2");

//Get the previouse values
_dialogValues = xSysLastValue::getValue(curExt(), curUserId(), UtilElementType::Job, "SaveLastValue");

//Check if we have previouse values
if(_dialogValues != conNull())
{
_dlgField1.value(conPeek(_dialogValues, 1));
_dlgField2.value(conPeek(_dialogValues, 2));
}

if(_dlg.run())
{
//Save the user choices
_dialogValues = conNull();
_dialogValues += _dlgField1.value();
_dialogValues += _dlgField2.value();

xSysLastValue::putValue(_dialogValues, curExt(), curUserId(), UtilElementType::Job, "SaveLastValue");

//Do what ever
}
}



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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: How to use default dimensions as Dialog fields in dialogs [Dynamics AX 2012] Blog bot DAX Blogs 0 19.09.2012 20:11
ax-erp: How to pass value from MenuItemButton to a Dialog Class? Blog bot DAX Blogs 0 19.09.2012 20:11
ax-erp: How to Enable/Disable fields in a dialog Blog bot DAX Blogs 0 19.09.2012 20:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11

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

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

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