News

CHAIN OF COMMANDS X++ FOR DYNAMICS 365 FOR FINANCE AND OPERATIONS

Microsoft has developed new best practice guidelines for the development using X ++ in Dynamics 365 for Finance and Operations. In principle, Microsoft pursues the strategy that allows application customizations to be more easily integrated into upgrade scenarios in the ERP software.

Technically, Microsoft Dynamics AX for Finance and Operations (formerly Microsoft Dynamics AX) will successively replace the possibility of adapting the overlaying from the previous versions of the product through extensions.

The announcement for the sealing of certain areas of application was made concrete at the beginning of this calendar year with the help of the following chart.


Cusomizations to the App Platform, App Foundation and AppSuite with over layering are no longer best practices, and will be supported by 2017 for only 3 years. Customization via extensions, on the other hand, are supported and are a new best practice procedure in the ERP application Dynamics 365 for Finance and Operations. In the last Platform Updates, more and more customization possibilities of the extensions were supported e.g. modify an Extended DataType on a table field. The full flexibility for program changes from over-layering, however, is currently not supported with Extensions.

In order to meet this, Microsoft has announced a more flexible way for extensions to be customized with Chain of Commands feature (CoC). Chain of Command brings more possibilities in the adaptation of source code, far beyond events. The next command allows you to customize methods more flexibly. The following example shows how to use Chain of Command:

class InventPosting
{

InventTable inventTable

public void new (inventTable _inventTable)
{
inventTable = _inventTable;
}

protected getStandardVolume(inventTableType _inventTableType)
{
return _inventTableType.Heigt * _inventTableType.Width * _inventTableType.Width;
}
public void postLoadVolume(TMSLoad _tmsLoad)
{
ttsbegin;
_tmsLoad.Volume = this.getStandardVolume(inventTable.type());
_tmsLoad.Post();
ttscommit;
}
}

The previous approaches for adapting the individual methods such as post have been single events such as posting or posted.

With the help of Chain of Commands, additional logics using external variables, transactions etc. can now be provided by a wrapper around the standard functions.

In the following example, the standard volume calculation of an article by Chain of Commands and the use of the next command is extended without the default objects being adjusted. In addition, a transaction for calculating surcharges is used around the postLoadVolume functionality.

[ExtensionIf(ClassStr(InventPosting))]
class InventPosting_Extension
{
InventTable inventTable

protected getStandardVolume(inventTableType _inventTableType)
{
Volume volume = next getStandardVolume(_inventTableType);
return volume * inventTable.PackageFactor;
}
public void postLoadVolume(TMSLoad _tmsLoad)
{
ttsbegin;
next postLoadVolume(_tmsLoad);
_tmsLoad.CalcCharges();
ttscommit;
}
}

Through this announced function, extension adjustments can be displayed more flexibly in customer projects and implemented according to best practice guidelines.

On the page for the Dynamics 365 roadmap This innovation is officially described under the entry “Development and customization – method wrapping and chain of command”.

Teilen per
<< back to news