Good Morning,
I am trying to write Dialog in one of the Customized Button -->clicked()
Ex - void clicked()
{
Dialog dialog = new Dialog("Email");
DialogField custaccount,cust,vend;
custaccount = dialog.addField(extendedTypeStr(CustAccount ), 'Cust Account :' );
cust = dialog.addField(extendedTypeStr(NoYesId ), 'Customer :' );
vend = dialog.addField(extendedTypeStr(NoYesId ), 'Vend :' );
if(dialog.run())
{
info("Working");
}
}
I have created one job for trial
If i click Customer.get the lookup of CustAccount.
if i click Vend .get the lookup of VendAccount.
Is it possible.
can i write in clicked Method(Above Clicked()).
Please guide me.
Regards.
Any help would be greatly appreciated.
Thanks.
Have a great day.
*This post is locked for comments
Hi AX 2012 r3,
It looks for me a bit wrong.
1) Be specific in class names. "Dialog lookup" is too general and does not reflect purpose of this class.
2) You can use "description" method to set caption, please refer to tutorial_RunBaseBatch class.
3) Why do you need to override lookup if you have 2 controls ? You have it out of the box. When I suggested lookup override I was thinking about lookup that shows vendors or customers depending on radio button, but 2 controls maybe a solution as well.
4) You completely missing pack, unpack and variables in class declaration, please refer to tutorial_RunBaseBatch class.
5) I don't understand what are you trying to do with "i" and "j", code should look like:
if (dialognew.value() == Persn::Customer) { ... } else { ... }
Hi Ievgen,
I have created a new class
But when i change in radio button.the dot is styaing in first element.it is not selecting if i select vendor.
If i made change The look up is coming.
Please find the below screen shots and please rectify it
I am getting Vendor..But the Dot is not changing to vendor.
I have done somewhere wrong.
Please correct it.
Thanks.
Have a great day Ievgen.
Hi Martin,
Hope you are fine.
Yes i have seen.But i dont have in depth knowledge regarding RunBase and Sysoperation Dialog.
Yes i am Fresher.I have completed 10 months in Microsoft Dynamics AX.
Mostly i have worked on reports.
I am trying Ievgen Solution.
Thank you so much Martin.
Regards.
Yes, of course RunBase can do it - you've never see any? You call the class by a menu item button, it shows a dialog on client and then switch to server and execute your business logic there.
Nevertheless AX 2012 has a new framework for this - SysOperation. It will do a lot of things for you, so you don't have to write as much code as with RunBase. Create a data contract class for your three fields, then create a custom UI building class (extending from SysOperationAutomaticUIBuilder, which will generate the dialog for you), implement your lookup method and use registerOverrideMethod() to tell a dialog field to use your method instead. Then associate your UI builder with your contract through SysOperationContractProcessingAttribute,. I'm sure you'll find a plenty of examples, now when you know a few keywords.
Hi Ievgen,
Hope you are fine,
the requirement is if we click that button.this dialog should appear.
Can i meet this if i create a run base class.?
please guide me.
Regards.
Have a great day ievgen.
Why you don't want to create proper run base class ?
Hi Ievgen,
Yes you are right .It should be a radio button.
But where should i overwrite thismethod.
I am creating this dialog in Clicked() of Button.
Please tell me how to write
Regards.
Have a great day.
Hi AX 2012 r3,
What should happen if user check cust and vend in the same time ? Maybe it should be radio button...
You can create custom lookup and use registerOverrideMethod to override lookup of account control, here is an example ztirom.at/.../ax2012-dialog-custom-lookup
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,902 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156