Filter in menu item.

Hello axapta mates,

I have a problem showing the Item grid.

When I click on inventory management-> common forms → article details the form shows all the rows (image) but if I call the same “menu item” from a custom button only shows the first row.

(correct) → Called from menu.

(incorrect) → I Call the same Menu Item but from a button.

How I can show all the rows from the article details ??

Thanks !!

Well, i believe that your custom button is calling a menu Item of display type , and the current args will be carried by that object.

So to show all the records and not only the one in direct association, try to place this code in a normal form button(not menu item) in the clicked method:

Args args = new Args();
formRun formRun;
;

args.name(formstr(“PurchTable”));
formRun = New FormRun(args);
formRun.run();
formRun.detach();

This will open the form Only, and will not filter by the current record.

Thanks Daniel,

I was spending soo much time in complicated solutions and it was very simple.

Thanks again man.