Hi, I need to add a button in a RunBaseBatch class that I have created, and assign it a clicked method, could you give me an example on how to do it? thanks!
*This post is locked for comments
Hi,
Standard RunbaseBatch framework doesn't provide support for adding a button or click method.
If you can present the options in a combobox drop down instead, it is possible to override the modified method of the combobox control to achieve similar results.
Here's an example: devexpp.blogspot.hk/.../dynamics-ax-custom-lookup-in-dialog.html
Instead of a simple button with clicked(), use a menu item button. You can add it to dialog by Dialog.addMenuItemButton().
You'll find an example in BatchInfo.dialog().
That's what I just did, however I need a way to pass it parameters, which I think is not possi ble through this way right? thanks!
You can easily get a reference to your batch class - and it's all what you need! All other parameters can be exposed by public methods of the class.
It's as easy as this:
DialogRunBase dialog = _args.caller(); MyBatchClass myBatchClass = dialog.runBase(); myBatchClass .parmMyParameter();
This can actually be done without a MenuItem (see below) but I would recommend isolating any logic in a class or to use the SysOperationFramework instead.
Object dialog() { DialogGroup mainGroup; DialogRunbase dialog = super(); FormBuildControl dialogGroupControl; FormBuildButtonControl myButton; mainGroup = dialog.addGroup("Group"); dialogGroupControl = dialog.formBuildDesign().control(mainGroup.formBuildGroup().id()); myButton= dialogGroupControl.addControl(FormControlType::Button,'MyButton'); myButton.text("@SYS91539"); return dialog; } public void dialogPostRun(DialogRunbase dialog) { super(dialog); dialog.formRun().controlMethodOverload(true); dialog.formRun().controlMethodOverloadObject(this); } public void MyButton_clicked() { }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 4
Nayyar Siddiqi 2
NNaumenko 2