Skip to main content

Notifications

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 47

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

  • Harshit Singh Profile Picture
    Harshit Singh 47 on at
    RE: how to enable/disable a button or checkbox on a form which opened using a MenuItemButton on another form

    Hi Girish & Mohit,

    It gets worked.

    Thanks & Regards,

    Harshit

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: how to enable/disable a button or checkbox on a form which opened using a MenuItemButton on another form

    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

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how to enable/disable a button or checkbox on a form which opened using a MenuItemButton on 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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans