AX – D365FO – How to call Form with filtered records using code in AX 2012

Suppose you have a Form and you want to call another form passing some filters.

Go to Clicked() method of the “ViewSource” button and insert this code

void clicked()


   Args                 args = new Args();

   str                  menuItemDisplay = MenuItemDisplayStr(ERAInventJournalTable);


   MenuFunction         MenuFunction = new MenuFunction(menuItemDisplay, MenuItemType::Display);

   Query                q = new Query();

   QueryBuildDataSource qbds = q.addDataSource(tableNum(InventJournalTable));






Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s