|
01.09.2024, 14:28 | #1 |
Участник
|
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, напишите личное сообщение администратору. |
|
|
|