3 Sept 2013

Problem caused by using keyword as object name in Dynamics AX

When creating objects in Dynamics AX, it is advisable to use names which are not any keywords in Dynamics AX. Otherwise, you can end up with unexpected behavior.

Take a look at the table InventBuyerGroup. It has two fields named Group & Description.

Now suppose if I want to select the field Group from the table using a select statement, how will I do it?

1.InventBuyerGroup inventBuyerGroup;
2. 
3.select group from inventBuyerGroup;

Simple, So what is the catch you may ask? Well, the above statement will not compile and give an error. That is because the field name group is also a keyword in Dynamics AX. So, the compiler gets confused and cant understand that it is the field name that we are trying to refer here.

I'm not aware of any way of getting this work. Of course, there are workarounds like using a map but is that really needed? We can avoid a whole lot of this by just ensuring that we dont end up using any Dynamics AX keywords as object names

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...