I am being asked to clean unused Customers in our AX database. The challenge is defining "unused" of course.
Is there any diagram anywhere documenting the table's relationship in Dynamics AX 2009 ?
For example, I see the table LedgerJournalTrans
has the "AccountNum
" field. I guess I could extrapolate that if a Customer has no associated records in LedgerJournalTrans
, it is unused but I think it may be a bit more complicated than this.
Anything else I should watch for ?
Thanks!
I have had to do this before, and it really isn't terribly challenging, you just have to do your due diligence. I wouldn't feel as confident with ian_scho's method because it only checks two tables, but I'd say his method gets the 80%.
I would say your best method is to copy the class Classes\InventUnusedDimCleanUp
and modify the simple functions in the \run
method.
This is a base class that basically does the following, except I'm going to substitute InventDimId
with AccountNum
for solidarity:
AccountNum
) into an empty check table as a starting referenceData Dictionary\Tables
tree node over every table in the AOTCustAccount
or an EDT that extends it[TableId,FieldId]
sAccountNum
's that DO exist in the candidate tables, so that we will be left with a check table of AccountNum
's that were not found in any tableCustTable
the customers that are remaining in the check table, which have been deemed unusedThis should accomplish your task, but doesn't take in account any external systems or customization you may have...but it gets the 95%.