Search code examples
axaptax++dynamics-ax-2012-r2

Get control value from listPage in ListPageInteraction class


I have a form created from template ListPage, and I want to get control StringEdit value to filter records.

How to do it in ListPageInteraction class?


Solution

  • There are a couple ways you could do it. First, you could override the control's textChange() by creating the function public void myControl_textChange() in the interaction class to set a value in your ListPageInteraction class whenever the field's value is changed. Create a variable in the interaction class, along with a setter, and call it with the control's new value.

    You could also create a getter method in the ListPage form that grabs that control's value. Then call that from the interaction class whenever you need the value for the filter. Make sure the control has the autodeclaration property set to Yes and then use the control's text() method to get the value from the control.

    Either way should work. There are probably other ways to do it, but these are what I can think of off the top of my head.