‘View Details’ Button Does Not Work on EDT Fields Used in Forms Displaying Records from Customized Tables

In previous versions of Microsoft Dynamics AX, table relationships could be defined in the Application object tree under the Relations node of either an EDT node or a specific table node.

 

Starting with Microsoft Dynamics AX 2012, the use of relations on EDT is obsolete and should be deleted in its future versions.

 

All table relations defined under an EDT should be migrated since they should be defined on tables only. If this is not done correctly, the ‘View details’ option can be unavailable for EDT fields used in forms displaying records from customized tables. This problem might occur even though the ReferenceTable property on the EDT is set to some table and this EDT matches the type of the primary index from the corresponding reference table.

 

Our team came to a different possible solution to this problem, which is explained in the text below:

 

Firstly, you need to create a self-relation in the table whose primary index matches the EDT.

 

view details' button does not work on EDT fields used in forms displaying records from customized tables

 

Another option is to create a hidden menu item button, which opens the main form of the data from the table whose primary index matches the given EDT.

 

Next, on the grid displaying the records from this table set this button as a default action. ‘View button’ option will appear on right-clicking the first field in the grid.

 

It is important to note that this is not the best solution since this works only on forms containing a grid with the corresponding table set as the main data source.

 

If you want to use this field from the same table in other forms, the ‘View details’ button won’t be shown again, unless the previously mentioned conditions are fulfilled. This approach is used in the Sales agreements list page.

 

edt fields

edt fields 2

 

edt fields 3

Charts in AX7

Charts in AX 7 are new features that gives great visual overview on records and they are great improvement from the old way of creating charts on AX 2012.

 

They are usually used as Parts forms to another forms mostly to Workspaces and they shows calculated information represented as  graphs or charts.

 

For creating Form with chart is used “Hub Part Chart” pattern and this pattern is contained of HeaderGroup (optional) and Chart control.

 

Chart control contains 5 sub-nodes:

 

  • Bindings –used for binding records to specific range or group of records as some names or items or orders.
  • Series – used to specify series of data bind to specified Binding data as dates, calculated sums or quantities.
  • Secondary Y-Axes – used to specify second series that will be bind to Binding data.
  • Methods
  • Events

 

To be able to control Bindings in code you can use it the method from the chart DataSets(), same if we want to change the Series with code we can use method Measures()

 

List mdt = chartControlName.Measures();
ListEnumerator mdit = mdt.getEnumerator();
while (mdit.moveNext())
{
                    SysChartMeasure ms = mdit.current();
                    ms.parmKeyField(fieldStr(dataSourceName,ResourceTeamName));
}
chartControlName.Measures(mdt);
ds.parmCategoryField(fieldStr(dataSourceName, ResourceTeamName));
ds.parmDataSource(tableStr(dataSourceName));
chartControlName.parmCategoriesType(SysChartCategoriesType::String);
chartControlName.DataSets(fd);               
chartControlName.ZoomLimit(SysChartDateTimeInterval::Default);
chartControlName.update();

 

When you change the categories field in code to field that is from another type that defined one you must define the type of the categories.

 

Example we have chart with bindings (categories properties) to field TransDate from type date, and we try to change through code to field Name from type string we must use parmCategoriesType(SysChartCategoriesType::String) method.

 

When we change some parameters in the chart we need to use update() method for this changes to be refreshed to the current form.

 

There is possibility to do some action from menu item when you click on some part of the chart bars which is controlled with properties on the chart MenuItemType and MenuItemName or with override to a method DrillThrough() on the chart.

 

public void DrillThrough(str _contextObject)
{
       Args args = new Args();
       args.parmObject(hourStatisticsHelper.createRangeForOverview());
       args.record(PSOHourStatisticsAggEntity);
       new MenuFunction(menuItemDisplayStr(PSOTSTimesheetLineOverview), MenuItemType::Display).run(args);
}