Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

I know this is a fairly old question but if someone comes here looking for the answer, just call method clearDynalinks() on the object QueryBuildDataSource.

For example, you have created a Form and it is automatically filtering your Datasource because of the Dynalinks that Dynamics creates automatically, you solve it by putting the following code inside the init() method, on your form Datasource:

QueryBuildDatasource qbds;
;


qbds = this.query().dataSourceTable(tablenum(MyTableName));
qbds.clearDynalinks();

// Next line is optional, it clears initial ranges
qbds.clearRanges();

// if you need to add any ranges you can do it right after you clear the initial dynalinks / ranges

Hope it helps...

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top