Corruption of Views and Table Alias Duplicate in CRM 2011 after Polaris update

 

After Polaris, I have four customer solutions where I can’t create new or copy existing system views. When I do, I get the following error message:

<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #FF39F24C</Message>
<Message>Table alias a_6fc316606a37e011850618a90573b8df is not unique amongst all top-level table and join aliases</Message>
 

Of course, the GUID can differ in your error case. In my case the problem was related to a Custom Entity.

In addition, you will notice strange looking related entity lines if you look at the Filter definition of the copied view:

1

I ran a Microsoft support case, but at that time they couldn’t find a solution, and told me that it will be fixed in RU14. But now half a year later it is still a problem to my four customers’ Online organizations.

Problem

Researching the XML view definition you will easily notice the error – the link-entity is created as a duplicate with the duplicated GUID:

2a

 

Solution 1 – just modify the view definition itself

One solution, which I have relied on until now, was to create the new system view or copy an old one; then export the XML definition in a simple solution (containing only this single entity) and finally manually stripping away the duplicated “link-entity” section in the XML. This worked fine, but was hard work since I used a lot of system views which need to be recreated semiannually. Other people have also already found this a feasible work around, i.e.:

Help from other resources

Today I needed to copy the views semiannually and during that process I researched and found that now other people are facing similar errors. Thanks to this I think I now have a solution that can solve the error permanently! So thanks to these guys here for pointing me in the right direction:

Solution 2 – clean up Advanced View Definition

Here is a walk through of a solution that seems to have fixed the issue permanently for me. Overall its about cleaning up the Advanced Find XML definition since this seems to be the main problem. You need to repeat the process for each entity containing the problem.

  1. Open the entity’s System View definitions
  2. Open the “Advanced Find” view definition
  3. Clean up the Advanced Find view column to ONLY contain columns from the Entity itself (NO columns from related entities must be contained as view columns)
  4. Publish Entity
  5. Create simple “Temp” solution and add the Entity above (and only this Entity)
  6. Export Temp solution
  7. Backup the Zip file (just in case you need to go back)
  8. From the Zip file, extract “customizations.xml”
  9. Open customizations.xml in text editor
  10. Locate the “Advanced Find” view definition:
      1. 2
  11. Strip out the link-entity line(s), since there are no references to related entities anymore (they were cleaned out in step 3, but CRM does not clean up the fetchxml)
  12. Save the XML file
  13. Re-insert it into the Zip solution file (remember to keep the copied one as a backup)
  14. Re-import the solution into your Organization and publish the entity

Now you should be able to create new System Views or copy existing ones (even copy ones with View columns from related entities).

In my case I only had one link-entity line – and my problem was related to a Custom Entity I created. Hopefully this solution method is generic to other entities as well.

Comments are appreciated in case you find other solutions.

 

5 replies
  1. Derrick Attfield siger:

    Excellent post- however I found in our on-premise implementation of Dynamics CRM 2011 (with roll up 13 deployed) that all it took was to remove the linked entity fields from the Advanced Find View display columns, publish and the dreaded “table alias is not unique” error is resolved! No need for the exporting of the solution, editing the xml and reimporting of the solution.

    Svar
  2. Simon siger:

    I was just about to do a similar post describing this exact problem when I found yours.

    I didn’t realise that the Advanced Find XML was linked to the problem so thanks for sharing!

    Svar

Skriv en kommentar

Want to join the discussion?
Feel free to contribute!

Skriv et svar til Henrik Kappel Annuller svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *