I spent an embarrassingly long time today trying to solve a problem in AX that was pretty simple, once someone pointed out the obvious answer to me. Just in case anyone else is looking for the same thing (and for the amusement value), I thought I’d write it up.
A list page in AX 2012 always has a drop-down in the upper right, allowing you to filter the grid by one of a number of fields. I was asked to add a new field to the list of available fields. This didn’t seem like it should be a big deal. Now, I haven’t done much work specifically with list pages. But they’re still basically AX forms, and I’ve done plenty with “regular” AX forms. Going into the list page form definition, I couldn’t find anything that looked like a control for that drop-down. It just seemed to appear magically. I found a blog post explaining how an individual user can add a new field to the drop-down, but nothing on how a programmer could add a field to it for all users.
Until someone pointed out to me that the list of fields in the drop-down corresponded exactly to the list of fields in the grid below it. So the drop-down is basically just a way to filter on any individual field in the grid. So the answer, of course, was just to add the field to the grid.
Oh, and there’s one other oddball thing about list pages that I figured out a few weeks ago, after a similarly long amount of time banging my head against the wall. List pages can be used by both EP (Enterprise Portal) and via the regular AX client. So if you need to, for instance, override the “clicked()” method on a button on a list page, you need to change the display target from “auto” to “client” before AX will let you do that. (See this blog post for details.) I guess this isn’t a good idea if you’re using EP, but we’re not, so, in my case, it’s OK.