How to write X++ methods on the list page Form in Dynamics AX 2012

Scenario: I have a menu item that calls some class to execute business logic on the list page Form. List pages do not allow writing of code on the Form, as they used interaction class.

Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto, as shown in the below Fig:1.0


Fig: 1.0
Note: After this change, you won’t be able to use this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However if you are using only the Rich client Form then you are good to do this.

Proud To Be a DAX Developer :-)