This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
If you include the SysOperationInitializable class in a data contract using the implements command, the method initialize() gets available and can be overwritten.
This method can be used to initialize variables within the data contract. However, this method is only called as long as no usage data is found or it is not activated.
class TutorialSysOperationDataContract
implements SysOperationInitializable
{
date dialogDate;
}
public TransDate parmDialogDate(TransDate _dialogDate = dialogDate)
{
dialogDate = _dialogDate;
return dialogDate;
}
{
dialogDate = systemDateGet() - 365;
}
If you want the initalize() to always be called, you must extend the DataContract with the attribute SysOperationAlwaysInitializeAttribute.
class TutorialSysOperationDataContract
implements SysOperationInitializable
{
date dialogDate;
}