AX7 – Where are my DeleteActions?

After migrating an solution to the new Microsoft Dynamics AX (AX7) it’s likely that at some point you’ll face the fact that the Code Upgrade Service removed formerly existing DeleteActions from tables. Why does it do this and where are the artifacts now?

Don’t worry, the logic that was represented by the DeleteActions isn’t gone but moved sensibly.

Status in AX 2012

In AX 2012 the connection between Relation and DeleteAction was quite clear to everyone but still somewhat less than perfect – especially if you look at it from a customization perspective. I’ll use table LanguageTable as example to illustrate this. I think many of you created tables before that reference the different language codes in the system – let’s call one MyObjectTableTranslation for instance. Obviously you have to create a foreign key relation on it to table LanguageTable. Now the crucial point is that you have to actually customize LanguageTable and add a DeleteAction there (with value Restricted in this case) to gain a correct behavior.

AX7 solves this issue

The good news is: The architectural deficit was eliminated with AX7. That’s it, no bad things about it 🙂 They even were forced to do it, by the way. Still there is the possibility to define DeleteActions – though I think this is only due to legacy considerations – but the new and state of the art way to model the behavior is to use a property of the relation, namely
On Delete
The available values for OnDelete are the exact same ones as before:

  • None
  • Cascade
  • Restricted
  • CascadeRestricted
AX7 DeleteActions OnDelete Property

In my opinion LanguageTable is a excellent example because regarding the use of DeleteActions it was treated as an orphan in the past (and I guess this is due to the vast amount of needed references besides the fact that you wouldn’t change the contents of that table usually). And, more importantly it displays the need for Microsoft to do that architectural switch. The keyword here is package boundaries. In particular, LanguageTable belongs to Application Platform which would make it impossible to define a DeleteAction for my example MyObjectTableTranslation due to its package assignment. In standard AX there are loads of examples referencing the language table and most of them are located beneath Platform and in Application Suite, like EcoResProductTranslation to name only one.
If you are not familiar to the concept of packages and their boundaries yet you might want to get back here later because one of my following posts is going to address that topic and I will try to illustrate it a little. Besides there is a short overview in the Wiki about that, in the article Understanding the model split.

Leave a Comment