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.

"The element 'savedquery' has incomplete content. List of possible elements expected: 'LocalizedNames'" error occurs when importing a Dynamics 365 solution


View products that this article applies to.

Symptom

When attempting to import a solution in Dynamics 365, you encounter the following error:

"This solution package cannot be imported because it contains invalid XML. You can attempt to repair the file by manually editing the XML contents using the information found in the schema validation errors, or you can contact your solution provider.

Error code 8004801a."

If you click Technical Details, you see the following message along with additional error details:

"Schema validation of the customizations.xml file within the compressed solution package file failed. To manually validate and edit the file, you can download the schema file here and use an XML editor that supports schema validation to get more details."

The textbox showing additional details includes the following information:

"The element 'savedquery' has incomplete content. List of possible elements expected: 'LocalizedNames'."

The textbox also includes additional details such as part of the FetchXML used for the saved query (view).

↑ Back to the top


Cause

This error indicates a saved query (view) is included in the solution and the XML for that saved query definition is missing the LocalizedNames section. This may occur if someone has manually modified the customizations.xml file.

↑ Back to the top


Resolution

To allow the solution to import successfully, the LocalizedNames section within the XML for the saved query needs to be added. 

1. Extract the contents of the solution .zip file you are trying to import.

2. Open the customization.xml file in a text editor.

3. Refer to the error details which should include part of the fetchxml section from the saved query. You may need to find a unique section of this XML and then search within the customization.xml file to find a matching saved query. 

4. Once you have located the saved query that is referenced in the error details, update the XML to include the LocalizedNames section. An example of a saved query is provided below with the missing section in bold.

<savedquery unmodified="1">
            <isquickfindquery>0</isquickfindquery>
            <isprivate>0</isprivate>
            <isdefault>0</isdefault>
            <savedqueryid>{65ffaf9a-e8c5-432d-860b-32f841b00d87}</savedqueryid>
            <queryapi></queryapi>
            <layoutxml>
              <grid name="resultset" jump="name" select="1" icon="1" preview="1">
                <row name="result" id="accountid">
                  <cell name="name" width="300" />
                  <cell name="telephone1" width="100" />
                  <cell name="address1_city" width="100" />
                  <cell name="primarycontactid" width="150" />
                  <cell name="accountprimarycontactidcontactcontactid.emailaddress1" width="150" disableSorting="1" />
                  <cell name="statecode" width="100" />
                </row>
              </grid>
            </layoutxml>
            <querytype>0</querytype>
            <fetchxml>
              <fetch version="1.0" output-format="xml-platform" mapping="logical">
                <entity name="account">
                  <attribute name="name" />
                  <attribute name="telephone1" />
                  <attribute name="address1_city" />
                  <attribute name="primarycontactid" />
                  <link-entity alias="accountprimarycontactidcontactcontactid" name="contact" from="contactid" to="primarycontactid" link-type="outer" visible="false">
                    <attribute name="emailaddress1" />
                  </link-entity>
                  <attribute name="statecode" />
                </entity>
              </fetch>
            </fetchxml>
            <IntroducedVersion>9.0.0.0</IntroducedVersion>
            <LocalizedNames>
              <LocalizedName description="All Accounts" languagecode="1033" />
            </LocalizedNames>

          </savedquery>

5. After correcting the XML, select all of the components you extracted from the solution file and send them to a new .zip file.

6. Attempt to import the solution again.

NOTE: If there are multiple saved queries (views) missing the <LocalizedNames> section, the steps may need to be repeated for each view.

↑ Back to the top


More Information

If you are not sure of the correct saved query (view) name to provide for this section, you can find the name using the savedqueryid value and the Dynamics 365 WebAPI. In the example above, the savedqueryid value is 65ffaf9a-e8c5-432d-860b-32f841b00d87. You can then access the following URL in your web browser to return the name of the view:

https://<your dynamics 365 URL>/api/data/v9.0/savedqueries(<savedqueryid>)?$select=name

Example:

https://contoso.crm.dynamics.com/api/data/v9.0/savedqueries(65ffaf9a-e8c5-432d-860b-32f841b00d87)?$select=name

↑ Back to the top


Keywords: LocalizedNames, 8004801a, savedquery, Dynamics 365, solution, import

↑ Back to the top

Article Info
Article ID : 4463330
Revision : 2
Created on : 9/7/2018
Published on : 9/7/2018
Exists online : False
Views : 313