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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 17.01.2014, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
How to change Batch caption dialog field in run time. RunBaseBatch sample
Источник: http://alexvoy.blogspot.com/2014/01/...on-dialog.html
==============

<div dir="ltr" style="text-align: left;" trbidi="on">This is an example of a RunBaseBatch class that demonstrates how to change another dialog fields in run time.

Let's say we have a parameter of enum type, which selects the right business logic inside of Run method.

It is a good idea to change the main static text of the dialog as well as the batch caption that serves as a description for an eventual batch job (and tasks).

After adding this field in Dialog method we need to override Modified method for this field.


protected Object dialog()
{
FormComboBoxControl combobox;
dlg = super();

dialogEventType = dlg.addFieldValue(EnumStr(uapInterfaceEventType), eventType );
// to add details to the caption and task description in batch tasks
dialogEventType.registerOverrideMethod(methodstr(FormStringControl, modified), methodstr(tmxRunBaseBatchSample, eventType_modified), this);
// to avoid user input in the field
combobox = dialogEventType.control();
combobox.comboType(1);

return dlg;
}
In eventType_modified method we call two additional methods to apply the user input respectively for BatchCaption and MainInstruction fields.

private boolean eventType_modified(FormStringControl _control)
{
boolean ret = _control.modified();
if(ret)
{
this.setBatchCaption();
this.setMainInstruction();
}
return ret;
}
To get access to these dialog fields we use two different approaches. We find BatchCaption form control recursively inside of batch tab page based on its type.

private void setBatchCaption()
{
FormStringControl batchCaptionControl;

// to get the batch caption control; any of them if many
batchCaptionControl = this.getBatchCaptionControl(dlg);

if (batchCaptionControl)
{
batchCaptionControl.text(this.caption());
}
} // returns the batch caption form control if any in the dialog
private FormStringControl getBatchCaptionControl(DialogRunbase _dialog)
{
FormStringControl batchCaptionControl;

// recursive routine to look for the right form control of BatchCaption EDT
Object findBatchCaptionControl(Object _parentObject)
{
int i;
Object childControl;
Object foundControl;


for (i = 1; i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axtadka: Adding a field on dialog by addfield() method, when the type of EDT is known at run time, in Dynamics AX 2009 Blog bot DAX Blogs 0 17.11.2012 11:12
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
axaptapedia: RunBaseBatch Blog bot DAX Blogs 0 04.04.2009 22:05
axaptapedia: RunBaseBatch Blog bot DAX Blogs 0 31.03.2009 06:06
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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