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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.09.2024, 14:28   #1  
Blog bot is offline
Blog bot
Участник
 
25,554 / 848 (80) +++++++
Регистрация: 28.10.2006
alirazazaidi: How write a simple dialog for input In D365 Finance and Operations X++
Источник: https://www.tech.alirazazaidi.com/ho...log-for-input/
==============

What a difference between RunBase and RunBaseBatch.

RunBase is used to create dialog. While runBaseBatch can be used to set dialog box as batch job.



Today I have a simple tip. that help you to create a input box to get values. this class will create a dialog box. You can use this to replace your runable class logic.





class RequestCopyJob extends RunBase
{
DialogField fieldInvoice;
DialogField fieldName;

// Variables to store user input

CustomerInvoiceId _InvoiceId;

// pack() and unpack() methods are used to load the last value from user
// for our simple example we are not going to use them.
public container pack()
{
return conNull();
}

public boolean unpack(container packedClass)
{
return true;
}

public Object dialog()
{
Dialog dialog = super();

// Set a title for dialog
dialog.caption( ‘Simple Dialog’);

// Add a new field to Dialog
fieldInvoice = dialog.addField(extendedTypeStr(DSACustomerInvoiceId), ‘Invoice’);

return dialog;
}

public boolean getFromDialog()
{
_InvoiceId = fieldInvoice.value();
return super();
}

public void run()
{
// Set Dialog field value to find CustTable

EInvoiceServiceRequests _EInvoiceServiceRequest;

select forupdate * from _EInvoiceServiceRequest where _EInvoiceServiceRequest.CustomerInvoiceId ==_InvoiceId;
ttsbegin;
_EInvoiceServiceRequest.ResponseStatus = Agz_KSA_CT_ServiceStatus::SUCCESS;
_EInvoiceServiceRequest.update();
ttscommit;

}

public static void main(Args _args)
{
RequestCopyJob Job = new RequestCopyJob();
// Prompt the dialog, if user clicks in OK it returns true
if (Job.prompt())
{
Job.run();
}
}

}



Источник: https://www.tech.alirazazaidi.com/ho...log-for-input/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
alirazazaidi: How To Use Advanced Filter: D365 Finance and Operations Blog bot DAX Blogs 0 20.06.2024 15:11
alirazazaidi: Consignment Inventory Handling in D365 Finance and Operations Blog bot DAX Blogs 0 20.01.2024 19:04
alirazazaidi: How to set any Field mandatory without writing code in D365 Finance and Operations. Blog bot DAX Blogs 0 12.02.2023 02:27
alirazazaidi: How to use Customer Template In D365 Finance and Operations Blog bot DAX Blogs 0 29.03.2021 00:25
alirazazaidi: Parent child form Customization D365 for Finance and Operations Blog bot DAX Blogs 0 21.01.2018 16:14

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

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

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