Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"Table alias 'alias name' is not unique" when opening certain views in Microsoft Dynamics CRM 2011


View products that this article applies to.

Symptoms

A user may be unable to open views after Update Rollup 12. This issue happens when views of type "Advanced Find View" are modified to have fields from related entities added to the display column. Issue is identified both with Out Of Box or custom entities.

↑ Back to the top


Cause

While modifying the view, the link-entity node is available twice. But for a single type of link-entity node, it must be available only once.

↑ Back to the top


Resolution

Installing Microsoft Dynamics CRM 2011 Update Rollup 15 resolves the issue for the views which are modified after installing Update Rollup 15. The existing views identified before installing Update Rollup 15 throwing the error needs to be fixed manually.

Here is an example showing how to fix the issue on an existing broken view:


This is how to simply reproduce the issue.

1. Navigate to Settings, click Customizations, click Customize the System, point to Entities, select Account, and click View

2. Open “Account Advanced Find View” and click on “Add Columns”

3. Select “Primary Contact (Contact)” related entity in “Record Type” dropdown

4. Check the checkbox next to “Full Name” and click on OK

5. Click on Save and Close

6. Click on Publish all Customizations

7. Open “Inactive Accounts” view and click on “Edit Filter Criteria”

8. Add/modify/delete any filter criteria (change “Status = Inactive” to “Status = Active”), click on Ok and click on Save and Close

9. Click on Publish all Customizations

10. Again, in “Inactive Accounts” view, click on “Edit Filter Criteria” and Add/modify/delete any filter criteria (change “Status = Active” to “Status = Inactive”)

11. Click on OK

12. Click on Save and Close

13. Click on Publish all Customizations

14. Go to Advanced Find and select “Accounts” in “Look for:” dropdown and select “Inactive Accounts” in “Use Saved View” dropdown

15. Click on Results



Here is how we fix it (Using the example above used to reproduce the issue):

1. Launch CRM 2011 application.

2. Navigate to Settings, point to Customizations, and click Solutions.

3. Create a new solution and add Account entity to it without adding any dependencies.

4. Now save the solution and export it as an unmanaged solution.

5. Once the unmanaged solution zip file is saved then extract the file.

6. Open ‘customizations.xml’ file in a XML editor like Visual Studio 2012 and click CTRL+M+M on the keyboard to collapse the full XML.

7. Search for the view name which was throwing error. In this case it is ‘Inactive Accounts” and this will be present only once in the whole file.

8. This will expand only 1 savedquery in the XML.

9. In this section expand <fetchxml> element and look for <Link-entity>.

10. You will see that following XML is duplicated:

<link-entity name="contact" from="contactid" to="primarycontactid" visible="false" link- type="outer" alias="a_410707b195544cd984376608b1802904">
 
                    <attribute name="fullname" />

                    <attribute name="emailaddress1" />

                  </link-entity>

This should only be present 1 time.

10. Remove one entry of this XML from ‘customizations.xml’ file and save the changes.

11. Now zip the files again with edited customizations.xml, [content_Types].xml and solution.xml.

12. Import this zip file in to CRM application and publish all customization.

13. This will fix the problem with Account Inactive Views. This is how you can fix all the other views which are throwing this error.  

↑ Back to the top


Keywords: kbmbspartner, kbmbsmigrate, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2907665
Revision : 1
Created on : 1/7/2017
Published on : 12/4/2013
Exists online : False
Views : 152