Problem caused by using keyword as object name in Dynamics AX
Hello Readers, 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. A list of all keywords in Dynamics AX 2012 can be found here . I discovered one such issue in standrd Dynamics AX. 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? InventBuyerGroup inventBuyerGroup;
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 ca...