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 disable a button on a form based on the selected record

(0) ShareShare
ReportReport
Posted on by 154

When I select a record on the form and the status field(type enum) of the record  is "start" then the button "pickup " in the form  should be enabled.

Then I edit the record and update it from the form and  the status becomes "stop". Then when I select the record , then the "pickup" button should be disabled.

Where should I write the code in form level ? At the data source of the form or in form>datasource>field(status)>method?

Could you show the code..I am a beginner in ax2012

I have the same question (0)
  • Verified answer
    Blue Wang Profile Picture
    Microsoft Employee on at

    Hi PrachiGupta,

    You can override active() of datasource.

    Code like this:

    Button.enabled(Table.LoadStatus == Status::Start ? true : false);

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Sir,

    I found an earlier thread with consistent requirements, please refer to:

    community.dynamics.com/.../disable-button-when-selecting-data

  • PrachiGupta97 Profile Picture
    154 on at

    In an extension of a standard form in d365 , the active method can't be overridden. 

    1)So do we use event handlers ? If so which one?

    2)If I have multiple datasources in the form , then for which one do we write the code? 

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 660

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 489

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans