Schema Validation error while importing Solution

By | May 20, 2014

 

Recently we came across with the issue while importing a solution from our dev environment to another test environment. So we thought of sharing this with everyone so that others do not face the same problem.

 

Issue:

img1

img2

While importing a solution we received “Schema Validation Failed” and it said “The ‘label’ attribute is not declared”.

According to the error the “label” attribute which is been found in the solution i.e. in the customization.xml file is not valid.

Cause of the issue:

This issue occurs when you save a copy of system view of an entity which you cannot edit.

For example: Quote Product Inline Edit View from quote product entity, Order Product Inline Edit View from order entity or All Sales Team Members view from connection entity etc.

When you select option “Save As” view CRM will create copy of this view but the schema format of this view is not in a required format. When you will open this view in solution xml you will notice that columns which has been copied from the existing view has invalid format as show below i.e. label = “Role” is not supported.

<cell name=”record2roleid” width=”136″ LabelId=”query.4E3600FA-B9C8-49F4-B69A-51EBA06D9BDF.cell.role.label” label=”Role” />

Resolution:

There are two solutions to resolve this issue:

In our case we have copied a connection view “All Stakeholders” so we are providing steps considering connection entity.

1. Modify the view from entity customizations

a) Go to Settings –> Customizations –> Customize the System –> Expand the entities tab and open a connection entity views

img3

b) Open the view and remove the existing columns which have been copied from previous view and add them back in a view

img4

c) Save the view and publish the customization.
d) After that re-export the solution and import in your target environment.
e) The solution will import successfully.

2. Modify the customization.xml file manually

a) Extract your solution (.zip) file that you are importing
b) You will find the customizations.xml file in the extracted folder
c) Open this customizations.xml file
d) Find for a keyword ‘ label=”’ find the keyword label followed by space so you can easily find the exact location.
e) You will find the error location as highlighted in the below screenshot:

img5

f) Remove the label=”ColumnName” from the entire xml.
g) Then save the xml file and zip all the components from the extracted solution and import it.
h) This will import your solution successfully.

If you know which view you have saved from existing managed view then the first option will be the easiest way to resolve the issue. If you do not have idea from which view this would be causing, then you can go with the second solution.