I'm looking for more information on how the basic data types in AX 2009 are validated, in an effort to expand that system.
We know that some kind of data validation occurs in almost all the base data types in AX, most notably the date field, because of some of the shortcuts you can do that take advantage of this: For example, if you type only the number 4 in a date field, the system automagically turns it into a date representing the 4th day of the current month and year. I am looking to find if there is any similar functionality for strings that I might be able to override or control.
Because strings apparently are not currently modified due to contents the way dates are, I want to put one in place myself. My current approach is to override the modifiedField method of a handful of tables to call a custom class, which would clean the data so it does not contain problematic characters, such as \r, \n or \t (some fields would be excluded, of course). Is there a better approach, preferably one that could be made more global?
There are no low-level string or date overloads that can be accessed. Being able to manipulate every string on a global scale just doesn't make sense as something we would be able to access.
If that existed, the potential overhead you could introduce would be astronomical.
The way the Date
assignment works, is most likely a kernel (or compiler?) operator assignment overload of the =
sign to function as you described. And it only executes at variable assignment, not data validation as you suggested.