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

Form : Hide or show control and field

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

In a custom form, how to show and hide control or field now days ? If lets say I'm using Menu item display parameter, how is the code looks like and where we should put it ?

For example :I created form like below:

7612.Capture4.JPG

As this form called using menu item. I put enum parameter in its property. Several menuitem calling this 1 form, and I just put enum parameter each. So on certain enum value, some of the action pane above (lets say aptabCustomer) need to be hidden.

Also some field in the detail information (not showing in the image), will need to be hidden as well.

Where I should put the checking and how ? is it in this form or I should create Even Handler class for this ?

Thanks,

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi WWwong,

    If you are doing this customization for your own form, you don't need to use event handlers, just put code to init method and hide needed controls based on the value from enum parameter set up on menu item.

    Using event handlers for the object (form, table, and so on) in the same model will increase code complexity and make code less understandable and readable.

    If you have a form in one model (standard or custom), but you added controls via an extension in another model in this case you need to use event handlers or CoC methods.

  • Verified answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi WWwong, 

    As Sergei mentioned If you are doing you own form no need to use event handlers. 

    From the properties of aptabCustomer  control change the Auto declaration property to Yes.

    You need to get the Enum value from the menu items that has been called. 

    Check this link for more information 

    https://dynamics.folio3.com/2014/02/23/x-tips-and-tricks-passing-parameters-microsoft-dynamics-ax/

    Then based on your Enum value add this code:

    aptabCustomer.visible(false);

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 620

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 521 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans