views:

488

answers:

2

I have form with VendTable grid for example, which has CustAccount field.

I want to place button, click on which will open CustTable form where all customers are visible.

If I just put CustTable menuitem, then clicking on it will open CustTable form, but in this form only one record is displayed - one that has the same AccountNum as in vendTable.CustAccount.

How to open whole custTable? Is there better solution than create button, and then use ClassFactory::FormRunOnClient to display form?

PS. I need button, so RMB->"Go to the Main Table Form" doesn't count.

A: 

You have 2 options, you can either create a button and override its clicked() method, or use a MenuItemButton and assign an Action MenuItem to it.

Using MenuItems is a best practice, because it allows you to use the AX security & configuration framework. You can associate a class to the MenuItem and in the class' main() method you can run the FormRunOnClient() stuff as needed.

Velislav Marinov
+2  A: 

The problem is that the VendTable record is applied as an argument to the CustTable form, which then creates a dynalink. The solution is to avoid the argument.

Override the clicked method in the CustTable display menu item like this:

void clicked()
{
    this.menufunction().run(new Args(element));
}

This calls the CustTable form with the caller object only and without the record argument.

Jan B. Kjeldsen

related questions