web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

how to enable/disable a button or checkbox on a form which opened using a MenuItemButton on another form

(0) ShareShare
ReportReport
Posted on by 63

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

I have the same question (0)
  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    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.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    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

  • Harshit Tyagi Profile Picture
    63 on at

    Hi Girish & Mohit,

    It gets worked.

    Thanks & Regards,

    Harshit

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans