4 Mar 2016

Enable/Disable controls in List Page + AX 2012

My requirement like when my purchase order Status = Openorder i don't want new purchase
order Button.



Solution::
  1. in the AOT, expand Forms and find the form for the list page where the action pane button appears.
    Use the
    InteractionClass property of the form to get the name of the interaction
    class for the list page.
  2. Expand Designs, expand Design, and then expand the Action Pane. Get the name of each
    action pane button that you want to enable or disable based on the list selection.
  3. Expand Classes, right-click the interaction class for the list page, click Override Method, and
    then clickselectionChanged. The Editor window opens and displays the selectionChanged method.
  4. Check that Control which you want to Enable or Disable has property AutoDeclaration is set to Yes.


Write code like this before Super()

 if(purchTable.PurchStatus == PurchStatus::Backorder)
        this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,NewPurchOrder),false);
    else
        this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,NewPurchOrder),true);
    





No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...