If an AX table field directly uses the Extended Data Type (EDT) AmountCur or an EDT that derives from AmountCur, the field’s property sheet shows several additional entries, when compared to other fields of type real.
I couldn’t find any documentation on this in the Internet or the AX2012 development book, so I thought I’d try and find out from AX where these properties are used and what they are used for.
Some findings:
- In AX2012 R2 (.4051), the only non-Default setup that is used is CurrencyCode = CurrencyCodeField and this is only done on four fields in total – all of them on PurchReqLine:
- PurchPrice
- LineAmount
- PurchMarkup
- ProjSalesPrice
- The properties are encapsulated in methods of classes SysDictField.
- These accessor methods are only used in best practice checks.
My first guess on their purpose had been that they specify which table and field carry the information on the currency code and the conversion date for the amount field. This certainly would be an interesting feature.
But: The property RelationContext exists for specifying the currency code and it is actually evaluated in the context of workflows (see class ExpressionMetadataHelper.getCurrencyCodeFieldFromMetadata()). The relationContext is used in multiple places (PurchLine, VendInvoiceInfoTable and Line, PurchReqLine again, AccountingDistribution and several more).
So what is this? An Easter Egg? A future feature? A first version for specifying the currency code, later overruled by the relationContext property, but not removed? Magic?
Any other guesses?
(No, I really don’t have the answer, still found it interesting and maybe this blog will trigger someone to share additional information.)