Hi,
I have a form A which has a MenuItemButton which will then open a new form B when we click on this. The new opened form B has a button form control.
I want to disable that button when the form B will open on clicking that MenuItembutton. I am talking in context of standard forms.
And I can't write Event Hnadler on opened form B bcz that form is used in many other places as well, if I write there then functionality will change everywhere in the system.
Then How can I achieve that button will disable only when I opened the form B on click of that MenuItemButton only. Can I write COC or EH on clicked method of that button. If yes then how?
Thanks & Regards,
Harshit
Hi Girish & Mohit,
It gets worked.
Thanks & Regards,
Harshit
Hi Harshit, You can use args to find caller in formB and disable button in formB. However, I think you can't disable button in FormB from formA.
Check this thread
community.dynamics.com/.../how-to-disable-enable-button-on-form-by-calling-from-another-form
Hi Harshit,
You want to hide a button control on Form B when Form B is opened from Form A?
But Form B is used in many other places, so you need to achieve this only when it is opened from Form A.
If yes, you can get the caller menu item name and based on that you can disable the button. Use onInitialized event handler of Form B to disable the control. You can also use COC to hide the control. Its upto you whether to choose OnInitalized or COC for init method.
Thanks,
Girish S.
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156