3
votes

I have been setting up builds for quite some time now. To do this, I use the scripts Microsoft provided for AX 2012 (Build and deploy scripts for Microsoft Dynamics AX 2012)

There were some tweaks to be done in the scripts to get TFS working the way it should and it also involved some extra actions because we have code in the startupPost (fe precompilation with message window instead of compiler output form due to modification in the sysSetupFormRun class)

But what is haunting me for some weeks now is the XPO import. The provided script uses the latest CombineXPO tool to combine all of the XPO files that were fetched from TFS into one big XPO. Once that is done, the XPO is imported in Ax.

And the real problem here is that I do not trust the XPO import because we have frequently been seeing huge amounts of errors like :

Compiler ERROR: \Data Dictionary\Tables\EPSICParameters\EPSICParameters : Relation Currency is incomplete due to missing fields

And indeed the fields aren't there in Ax, but when I look in the XPO that was supposed to be imported,the relation fields are present which indicated that the sources were fetched fine from TFS.

REFERENCE #Currency
    PROPERTIES
      Name                #Currency
      Table               #Currency
      RelatedTableCardinality   #ZeroOne
      Cardinality         #ZeroMore
      RelationshipType    #Association
      UseDefaultRoleNames #Yes
    ENDPROPERTIES

    FIELDREFERENCES
      REFERENCETYPE PKFK
      PROPERTIES
        Field               #CurrencyCode
        RelatedField        #CurrencyCode
        SourceEDT           #CurrencyCode
      ENDPROPERTIES

    ENDFIELDREFERENCES
  ENDREFERENCE

Anyone who could help me out here? This thing is really blocking our automated builds with Ax because we simply cannot tell when the next build is going to run fine :s

2

2 Answers

3
votes

I had this error as well. I believe that the root cause of this is due to the relation being auto created when you drag and drop an EDT onto a table to create a field, and then a rename of that field breaking the table relation. However, the EDT relation will still work on the field and the front end/GUI will not break. For example, dragging the HcmApprover EDT onto a table will prompt you to ask if you want to add the ForeignKey relation from the EDT to the current table? If you say yes, and then rename the field from HcmApprover to something else, the table relation will break. However, the front end will appear to work correctly (you will likely still be able to see a working dropdown to view hired workers from the HCM module).

I'm not positive, but I think the GUI still works because of the EDT relations on the field itself causing the front end to still operate correctly.

Either way, if you drag and drop EDTs (this goes for more than just EDTs) to create fields and do any renaming, make sure that the appropriate auto/framework-generated "stuff" is also renamed manually (ie by you).

1
votes

Try doing the import twice, ignore any errors from the first run.