The dependent component SavedQuery (Id=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx) does not exist. Failure trying to associate it with SystemForm (Id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx) as a dependency. Missing dependency lookup type = PrimaryKeyLookup.

The following error occurred when attempting to import customisation from CRM 2013 On Premise UR3 to SP1 UR1.

The dependent component SavedQuery (Id=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx) does not exist.  Failure trying to associate it with SystemForm (Id=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx) as a dependency. Missing dependency lookup type = PrimaryKeyLookup.

So, I ran the query below on the CRM database to find which form and savedquery have the problem.

select * from filteredsystemform
where formid = 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

select * from FilteredSavedQuery
where savedqueryid = 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

The systemform record points to the case entity but the savedquery record does not exist. A custom view might have somehow been deleted while still referenced in the form.

So, I exported the entity customisation and searched for the savedquery guid. The guid was indeed referenced in the customisation XML. Strangely enough, the EnableViewPicker is set to False, therefore, the ViewIds should have only one value but it has two in the xml.


I could just update the customisation xml and re-import it back, but I thought updating the subgrid on the case form might just fix it. So, open the subgrid properties dialog, set View Selector to 'Show All Views', save and publish the changes. Then re-open the same dialog, set View Selector to Off, save and publish the changes. This does clean up any invalid savedquery ids in the ViewIds tag.

Once the ViewIds is fixed, the solution is then imported successfully in the target environment.

Comments

Hicham said…
I had a similar problem...so i just removed all the grids from the form the error went away.

Popular posts from this blog

Error in workflow sending email: "You cannot send email as the selected user."

Metadata contains a reference that cannot be resolved