Pages

Friday, May 5, 2017

How to remove the default filter controls on a ListPane in AX 2012

When you create a ListPage, the kernel automatically adds a FormFilterPaneControl with some filtering options. Many think this can't be removed or hidden, but it can!



It is added during the run method's super() call by the kernel, so using this code on the ListPage you can remove it.  The caveat is if you are using the ListPage FormTemplate, it's not possible because you're not able to override the run method.

The last closing comment I'll add is I don't know if the kernel expects the control to be there later on and if this can cause any issues or not. I just was curious if I could get it to go away.


public void run()
{
    int                 i;
    FormControl         formControl;

    super();
    
    for (i=1; i<=element.design().controlCount(); i++)
    {
        formControl = element.design().controlNum(i);

        if (formControl is FormFilterPaneControl)
        {
            element.design().removeControl(formControl.id());
        }
    }
}


6 comments:

  1. Thank you for posting this tip Alex. I hope this post helped clear the misconception a lot of the readers might have. Do keep posting more helpful content.

    ReplyDelete
  2. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. windows iso

    ReplyDelete
  3. Nice, thx a lot. I was wondering why there is no way to disable these controls on the form :(

    ReplyDelete
  4. More free time will be after, I can advise you how to do it perfectly and you will have many times, this site https://rankmywriter.com/gonerdify-com-review will help you to complete any written work, while you find time for yourself and for relaxation

    ReplyDelete
  5. If you go down the route of utilizing a credit card, the minimum transaction is quite of|is type of} hefty at $45. It drops down to only $20 if you go for one of many crypto choices. People who love a prestigious and skilled colour scheme will take pleasure in what MYB Casino brings to the table. The black and gold design offers an expensive feeling to users. The navigation system is great, 1xbet korea so you don’t have to fret about having bother discovering what you are be} in search of.

    ReplyDelete
  6. Wonderful information! Thanks so much for sharing such valuable content with us. Your blog always provides the best and most interesting insights on important topics.

    business tax preparation Fort Worth TX

    ReplyDelete