Friday, February 24, 2012

List Pages in AX 2012

Scenario: Add a few fields or buttons to a list page and making it visible/invisible depending on certain conditions. No more possible by writing code on the same form since addition of methods is no more possible in case of LIST PAGES.
We have an interaction class for all the list pages. Taking the example of form -> SalesTableListPage for which the interaction class is -> SalesTableListPageInteraction.

In this class, we have 2 methods:
setButtonVisibility() - To set the buttons visible/invisible
setGridFieldVisibility() - To set the fields visible/invisible

To make a button visible/invisible, we can write below code:
this.listPage().actionPaneControlVisible(formControlStr(SalesTableListPage, NewGroup),false);

To make a field visible/invisible, we can write below code:
this.listPage().listPageFieldVisible(formControlStr, (SalesTableListPage,SalesTable_lftCostHoldReasonCode),false);

1 comment: