Thursday, October 7, 2010

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId.)

 

Yesterday I was trying to install Dynamics AX 2009 . Suddenly I received the following error when I started the Synchronize Database Step in Initialization Checklist :-

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId 1

Then I started to think why this error occurred. Maybe because I changed some of the properties in the Modify Data Types Step . So I returned back to Modify Data Types Step and changed back everything to their Default Values but unfortunately everything is the same . I tried to Synchronize again and the error occurred.

So I finished all the Steps in Initialization Checklist and started to investigate.

I opened AOT > Data Dictionaries > Views > Dirpartyview > Fields .

And then I saw the StringSize Property of both the fields ( AccountNum, PartyId ). and Woooh they are not the same. so that’s why they are not compatible.

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId 2

 

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId 3

 

If you noticed both fields Data Source Property is the CustTable . so what you need to do is going to CustTable and right click on PartyId field and choose Add-Ins > Open new window > Open used Extended Data Type

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId 4

 

Then you will notice StringSize Property of DirPartyid changed it to be the same as AccountNum StringSize Property.

Error While Synchronizing Database In Dynamics AX 2009 (There is a field mismatch in the union query. Field AccountNum is not compatible with field PartyId 5

 

That’s it Smile . Save your changes and Synchronize the Database Again.

Maybe you will have warnings that few tables will be dropped and recreated but it is okay as long as you don’t have any data yet.

 

Conclusion:-

I didn’t know what is exactly the reason for this error. Maybe it is bug or maybe something wrong I did in the Initialization but there’s a solution for it Smile.

8 comments:

  1. Hi

    I have same problem after upgrading the rollup6 hotfix but different table name InventvaluereportresourceIdlookup error message "Synchronize database there is a field mismatch in the union query. Field ResourceName is not compatible with field ResourceName.

    I already check the resourceName and compare to Itemname in Inventtable. and it is the same what is the possible solution?

    ReplyDelete
  2. @Anonymous : what is the name of the two fields that are mismatched?

    ReplyDelete
  3. hi,

    I have the same problem as Anonymous, I can't seem to figure it out.

    I'm pretty new to ax and this has thrown a spanner in the works big time.

    ReplyDelete
  4. @nick62: what is the name of the two fields that are mismatched?

    if you can give me more details so i can help :)

    ReplyDelete
  5. The problem is probably because you have a different length of the ItemName EDT. The three used edt:s are: ItemName, WrkCtrName and CostSheetNodeDescription. All these three EDT inherits Name (60) in standard AX 2009. If you have an customization on either one of these, the sync will not work. For example if you have ItemName set as length = 50, there will be a sync problem in the upgrade guide (when synchronize database is run).

    Best regards

    Richard Hellstenius
    Accigo AB
    www.accigo.se

    ReplyDelete
    Replies
    1. Hi Richard, I experienced the same error with Anonymous and nick62. Your solution is exactly working for me! Nice!

      Delete
  6. Thank you very much! It really helped me while upgrading from AX 2012 R2 to R3. I just got an error like this one and thanks to you... it's fixed! Greetings!

    ReplyDelete