≡ Menu




Enable and Disable an Action Pane Button on grid row change Dynamics Ax 2012

This is very simple tip. That usually found that when we move record to record in list page, from top Action pane button enable or disable as result of this movement.  This functionality required one of my customization from.

For example, I have to enable and disable button on action pane “BtnGenerateLine”  based on status / enum field of table.

 

 

Step 1, right click on button and its set its auto declaration property to true.

Btn

Now right click on Data Source of form which bind to grid and overwrite SelectionChanged Method

 

Selection change

 

So Code snippet will be something like

public void selectionChanged()

{

super();

 

 

if (CustTabletmp.StatusProcessed == StatusProcessed::LineProcessed)

{

BtnGenerateLines.enabled(false);

}

else

{

BtnGenerateLines.enabled(true);

}

 

 

}

 

{ 0 comments… add one }

Leave a Comment