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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Disable Button when Selecting Data

(0) ShareShare
ReportReport
Posted on by 209

Hello All,

I need help here.

1817.Q.png

Warehouse management > Common > Load planning workbench

If the Load Status is "Open", then the Release Button must be Enabled (Default)
If the Load Status is Not "Open", then the Release Button must be Disabled. 

must be triggered upon clicking a data.

is this possible? 

Please help, thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    5400 Profile Picture
    7,162 on at

    Yes,It is possible. you can achiev through active method which will be good pratice this type scenarion. But if you want through button click also possible.

    Make release button - as autodiclartion yes

    and put the logic.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    of course, on any form buttons can be enabled/disabled by writing code at active() method.

    But, very important thing is to know/read existing logic. how your code will behave in combination with existing business process? are those buttons already being enabled/disabled by any business process? these questions must be answered before you start writing code at active() method.

    sometimes form(s) do have a interaction class, where the buttons enable/disable is being handled based on many aspects, those need review.

    it is not about possible/impossible. its about reading your customization in combination with existing business process.

  • XSpy Profile Picture
    209 on at

    the Release button is always Enabled, I just want to add the Disable function.

    can you help me with the code? thanks.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    check if there is existing active method on datasource; if not do override it by right clicking methods node of datasource, and then write code after super() as under

    if(condition)

       {

           ButtonName.enabled(true);

       }

       else

       {

           ButtonName.enabled(false);

       }

  • Verified answer
    5400 Profile Picture
    7,162 on at

    Please go to

    \Forms\WHSLoadPlanningWorkbench\Designs\Design\[Tab:DemandLoadsTab]\[TabPage:TabLoad]\[ActionPane:ActionPaneLoad]\[ActionPaneTab:ActionPaneTabLoad]\[ButtonGroup:Info]\[MenuButton:ReleaseMenuButton] -

    ReleaseMenuButton - do autodeclartion yes.

    \Forms\WHSLoadPlanningWorkbench\Data Sources\WHSLoadTable\Methods\active-- before return write below code

    ReleaseMenuButton.enabled(WHSLoadTable.LoadStatus == WHSLoadStatus::Open ? true : false);

  • XSpy Profile Picture
    209 on at

    Thanks Sohaib Cheema, Bhaskar Roy!

    the code works,

    but there's one more flaw here. 

    1273.W.png

    the WHSLoadTable is linked in the bottom part of the Form (Loads).

    the Load status in the upper part is also part of WHSLoadTable, but the active method only works in the bottom part of Form.

    i need it to work in the upper Load status, not the bottom one.

    *im trying the code : 

    ReleaseMenuButton.enabled(WHSLoadTable.LoadStatus == WHSLoadStatus::Open ? true : false);

    in other DataSource to see if it might work, but might as well ask if you know where to put it.

  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at

    we are not sure about status field which is appearing in upper part, as system is in your hand; whether that belongs to WHSLoadTable or some other Datasource

    Or may be it is because of upper gird is bound to another dataSource.

    from your above screenshot(1st one) it seems that it may be part of SalesLine

  • XSpy Profile Picture
    209 on at

    yes thanks for the answers, i'll try to put it in every Datasource to try it. Thanks!

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans