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

Announcements

No record found.

News and Announcements icon
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

  • Verified answer
    GirishS Profile Picture
    27,845 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,573 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
Martin Dráb Profile Picture

Martin Dráb 532 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 351 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 195

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans