Parameter passing in Dynamics Ax

Good evening,

A conversation with a collegue made me realize that for developpers coming from VB, wether parameters are passed by reference or by value is not an obvious thing to figure out. Generally, parameter passing in DAX is always done by value except for class instances and records.

 
Major base types in Dynamics Ax
 
String = Assigned and passed by VALUE
Integer = Assigned and passed by VALUE
Real = Assigned and passed by VALUE
Date = Assigned and passed by VALUE
Enum = Assigned and passed by VALUE
Container = Assigned and passed by VALUE
Record = Assigned and passed by REFERENCE
Class instance (any object instanciated with ‘new()‘) = Assigned and passed by REFERENCE
AnyType = Assigned and passed by VALUE, even when holding a Record or Class instance
Guid = Assigned and passed by VALUE
Int64 = Assigned and passed by VALUE
This entry was posted in Dynamics Ax 4.0x. Bookmark the permalink.