• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4202
  • Last Modified:

Filter data in Grid

Hi all,

I am using Microsoft Dynamics AX 4.0 and what i would like to do is to filter the records shown in a Grid on my Form. The data shown in the Grid is from the table SalesParmTable. It displays fields ParmId, TransDate and DlvMode.

I only want the records where Ordering = 'Picking list' and   SalesId = the SalesId that is selected by the user.

I have tried to write a query (in the textChange method of the field where the user selects the SalesId) to set as the datasource of the grid but i couldn't get it to work.

I am quite the beginner when it comes to programming in X++ so describing every step would be much appreciated.

Thanks in advance
-M3mph15
0
M3mph15
Asked:
M3mph15
  • 2
  • 2
1 Solution
 
quale-kaizenCommented:
Do you use the salesEditLine form, or a custom one?
0
 
quale-kaizenCommented:
Try to override the modified method of the salesId field on the form.
This code assumes you the name of your datasource is 'salesParmTable'.
public boolean modified()
{
    boolean ret;
 
    ret = super();
 
    if(ret)
    {
        salesParmTable_ds.filter(fieldNum(salesParmTable, SalesId), this.text());
    }
    return ret;
}

Open in new window

0
 
M3mph15Author Commented:
Thankyou quale-kaizen. Your solution worked perfectly.
0
 
M3mph15Author Commented:
Thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now