locked
CRM 2011 - RU10 - Error when import solution: The element 'savedquery' has incomplete content. List of possible elements expected: 'LocalizedNames'. RRS feed

  • Question

  • Hi All.

    Just updated CRM 2011 instance for my development server from RU8 to RU10.

    Then realize if i export a solution with entity schema inside (include entity account, for example) and try to import again (Did not change anything), the process will fail with an error message started with

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

    Has anyone else got similar error message?

    Jaimie



    • Edited by Jaimie_J Friday, August 24, 2012 3:13 PM
    Friday, August 24, 2012 3:05 PM

Answers

  • Hi there,

    we did come across the same problem and logged a bug with support (the only reliable way to get it fixed, mind you). While official hotfix is in the making (or so I was told), you can download my version. I'll blog about it more later on but here is the gist:

      • It's the source code (VS2010 project) plus executable for daredevils.
      • Similar to the brief code fragments already posted here, and unlike XML tweaks, it runs against organisation. So to fix the solution, fix the organisation then export the solution again.
      • Works against on prem, hosted and CRM Online (both flavours, Live ID & OSDP/O365).
      • To build the project, you'll need VS2010 and CRM 2011 SDK.
      • It uses late binding and utilises microsoft.xrm.client.dll - make sure to include it.
      • For those living on the edge:  exe is in bin folder. You'll need the usual CRM SDK libraries plus microsoft.xrm.client.dll in the same folder or in GAC.
      • To check your organisation just run
        Georged.FixUR10.exe
      • To fix your organisation
        Georged.FixUR10.exe fix
      • We have reports about dashboards being broken in a similar fashion. Code takes care of them as well.
      • English 1033 only. Search the code for SetLocLabels to add labels in your favourite language.
      • It's a political development, i.e. it strictly follows "No Comments" policy
      • Little bird called logic tells me that charts may be broken as well but I'm yet to come across any. Ping me if after the fix you still get message about LocalizedNames when importing the solution.

    Good luck.

    George


    George Doubinski, MVP http://crm.georged.id.au

    • Proposed as answer by Smeagul65 Wednesday, September 12, 2012 9:02 AM
    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:48 AM
    Wednesday, September 12, 2012 12:15 AM
    Moderator
  • That will create missing lables and will fix the problem.

    foreach (SavedQuery view in datacontext.SavedQuerySet.Where(s => s.QueryType == 8192))
                    {
                        view.Name = view.Name + "";
                        datacontext.UpdateObject(view);
                        if (i > 50)
                        {
                            i = 0;
                            datacontext.SaveChanges();
                        }
                    }
                    datacontext.SaveChanges();

    • Proposed as answer by Martin Kathriner Tuesday, September 11, 2012 1:01 PM
    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:31 AM
    Friday, September 7, 2012 1:41 AM
  • I agree lexa777 has a good solution, unfortunately if you have any issues with a view such as one that was never deleted from CRM when you deleted the entity you will have some issues. I like using the data context too but in this case I went back to a query expression and a regular update so I could do some error handling instead of doing everything in one transaction.

    Console.WriteLine("Working.");

    QueryExpression query = new QueryExpression() { EntityName = "savedquery", ColumnSet = new ColumnSet(true) };
    ConditionExpression cond1 = new ConditionExpression();
    cond1.AttributeName = "querytype";
    cond1.Operator = ConditionOperator.Equal;
    cond1.Values.Add("8192");
    query.Criteria.AddCondition(cond1);

    EntityCollection ec = _serviceProxy.RetrieveMultiple(query);

    foreach (Entity ent in ec.Entities)
    {
    try
    {
    Console.WriteLine(ent["returnedtypecode"]);
    ent["name"] = ent["name"] + "";
    Console.WriteLine("Name: "+ ent["name"]);
    if (ent.Contains("description"))
    {
    ent["description"] = ent["description"] + "";
    Console.WriteLine("Desc: " + ent["description"]);
    }
    Console.WriteLine();
    _serviceProxy.Update(ent);
    }
    catch(Exception e)
    {
    Console.WriteLine("======== ERROR =========");
    Console.WriteLine(ent["returnedtypecode"]);
    Console.WriteLine(e.Message);
    Console.WriteLine(e.InnerException);
    Console.WriteLine("====== END ERROR =======");
    Console.WriteLine();
    }
    }

    Console.WriteLine("Done.");

    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:31 AM
    Tuesday, September 11, 2012 1:26 PM
  • The UR10 packages have been published to the download center.

    http://www.microsoft.com/en-us/download/details.aspx?id=30711.  The new packages has the version  .2740.

    This issue with "Missing LocalizedLabel record for new SavedQuery" is fixed in this UR10.


    Arpita

    Thursday, October 4, 2012 6:25 PM

All replies

  • I have the same issue.

    I think tan only happends in environmets that have been migrated from versión 4.0.

    The problem is that the export includes a new savedquery (view) without de "LocalizedNames" XML tag. If you open the Customization.xml file, and remove that SavedQuery, it imports ok, but i don't know why this happens.

    Anyone to knows another way (and supported) to solve this?

    thanks!


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com

    Tuesday, August 28, 2012 8:35 AM
  • Hi.

    Just to follow up with the issue.

    I agree with Demian that the problem seems only related with CRM which was migrated from version 4.0 to version 2011.

    I have found that the view mising 'LocalizedNames' seems related with 'My active....' in my case. (custom entity)

    When the solution is exported, it always exports one extra view in the XML compared with what i can see in the CRM 2011 solution design.

    It is okay to fix the import by removing the view in the xml file, however if it is a generic issue that means there will be a certain number of entities which needs the view to be removed manually every time when solution is exported.

    However, it will not work if the solution is managed and definately should not be the approach to import into production server.

    This is not ideal and has not happened before RU10.

    Jaimie



    • Edited by Jaimie_J Tuesday, August 28, 2012 9:57 AM
    Tuesday, August 28, 2012 9:49 AM
  • I agree with you Jaimie_J, this "should not be the approach to import into production server".

    Anyone knows if there is any Hotfix or another way to fix this problem?

    thanks,


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com

    Tuesday, August 28, 2012 10:07 AM
  • Any further movement on this issue?  I'm having this problem but the only savedquery I'm seeing with my entity that does not have a LocalizedName is the offline query, querytype=8192.  Those appear to be offline views.
    • Edited by RWils Tuesday, August 28, 2012 1:02 PM
    Tuesday, August 28, 2012 12:52 PM
  • Please open a case with Microsoft Support.  I think they might be aware of the issue.  If so, logging a support case will ensure you have the latest information on the issue and a fix when it is available.

    Regards, Donna

    Tuesday, August 28, 2012 1:21 PM
  • Hi.

    Already. The process is on going and will keep updated.

    Jaimie

    Tuesday, August 28, 2012 1:27 PM
  • Great! thank you.


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com

    Tuesday, August 28, 2012 3:20 PM
  • I have also just hit the same issue. I'll also push Microsoft for a hotfix.

    Josh - if a support case is acknowledged by Microsoft as a Microsoft bug, you should not be charged for it. This is clearly a Rollup defect in my book.

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Wednesday, August 29, 2012 12:22 PM
  • I also opened an MS ticket on this one since I had a few left. Hopefully they will fix this soon since this is affecting all my devs.

    --Rick

    Wednesday, August 29, 2012 1:16 PM
  • Rob is correct, the support case should not be counted against you since this is a bug.

    Regards, Donna

    Wednesday, August 29, 2012 3:20 PM
  • Cheers, I didn't know that :)

    Josh Ash

    Wednesday, August 29, 2012 11:02 PM
  • Latest update, any hotfix is likely to be 2-3 weeks away. I attempted to downgrade my environments to rollup 8 then tried to export and import the solution but received the same error.

    Looks like the XML hack is the only way forward at the moment (assuming you're using unmanaged solutions).

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Friday, August 31, 2012 2:30 PM
  • This is what I sent to my Devs for the temp fix.

    How to fix solution import file that will not import due to the following error:

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

    -Extract customizations.xml

    -Edit with XML notepad

    -Search XML for 8192


    -If savedquery does not have a LocalizedName element delete the savedquery element.  If it does have a LocalizedNames element leave it there.


    Friday, August 31, 2012 3:19 PM
  • Hi.

    The temp solution has been mentioned in the previous post but thanks for that.

    Again, this will not work for managed solution and should not be applied to any QA and Production environment.

    Jaimie


    • Edited by Jaimie_J Sunday, September 2, 2012 7:10 PM
    Sunday, September 2, 2012 7:10 PM
  • Thank you Rob Boyers,

    there is no other way to wait 2-3 weeks more.

    Demian.


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com

    Monday, September 3, 2012 8:54 AM
  • That will create missing lables and will fix the problem.

    foreach (SavedQuery view in datacontext.SavedQuerySet.Where(s => s.QueryType == 8192))
                    {
                        view.Name = view.Name + "";
                        datacontext.UpdateObject(view);
                        if (i > 50)
                        {
                            i = 0;
                            datacontext.SaveChanges();
                        }
                    }
                    datacontext.SaveChanges();

    • Proposed as answer by Martin Kathriner Tuesday, September 11, 2012 1:01 PM
    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:31 AM
    Friday, September 7, 2012 1:41 AM
  • I have the same issue. Thanks for posting the solution/workaround again!

    Waiting on RU11 ...

    Stefan

    Tuesday, September 11, 2012 8:03 AM
  • That will create missing lables and will fix the problem.

    foreach (SavedQuery view in datacontext.SavedQuerySet.Where(s => s.QueryType == 8192))
                    {
                        view.Name = view.Name + "";
                        datacontext.UpdateObject(view);
                        if (i > 50)
                        {
                            i = 0;
                            datacontext.SaveChanges();
                        }
                    }
                    datacontext.SaveChanges();


    The Solution from lexa777 works like a charm. Thank you for that.
    Tuesday, September 11, 2012 1:03 PM
  • I agree lexa777 has a good solution, unfortunately if you have any issues with a view such as one that was never deleted from CRM when you deleted the entity you will have some issues. I like using the data context too but in this case I went back to a query expression and a regular update so I could do some error handling instead of doing everything in one transaction.

    Console.WriteLine("Working.");

    QueryExpression query = new QueryExpression() { EntityName = "savedquery", ColumnSet = new ColumnSet(true) };
    ConditionExpression cond1 = new ConditionExpression();
    cond1.AttributeName = "querytype";
    cond1.Operator = ConditionOperator.Equal;
    cond1.Values.Add("8192");
    query.Criteria.AddCondition(cond1);

    EntityCollection ec = _serviceProxy.RetrieveMultiple(query);

    foreach (Entity ent in ec.Entities)
    {
    try
    {
    Console.WriteLine(ent["returnedtypecode"]);
    ent["name"] = ent["name"] + "";
    Console.WriteLine("Name: "+ ent["name"]);
    if (ent.Contains("description"))
    {
    ent["description"] = ent["description"] + "";
    Console.WriteLine("Desc: " + ent["description"]);
    }
    Console.WriteLine();
    _serviceProxy.Update(ent);
    }
    catch(Exception e)
    {
    Console.WriteLine("======== ERROR =========");
    Console.WriteLine(ent["returnedtypecode"]);
    Console.WriteLine(e.Message);
    Console.WriteLine(e.InnerException);
    Console.WriteLine("====== END ERROR =======");
    Console.WriteLine();
    }
    }

    Console.WriteLine("Done.");

    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:31 AM
    Tuesday, September 11, 2012 1:26 PM
  • Hi there,

    we did come across the same problem and logged a bug with support (the only reliable way to get it fixed, mind you). While official hotfix is in the making (or so I was told), you can download my version. I'll blog about it more later on but here is the gist:

      • It's the source code (VS2010 project) plus executable for daredevils.
      • Similar to the brief code fragments already posted here, and unlike XML tweaks, it runs against organisation. So to fix the solution, fix the organisation then export the solution again.
      • Works against on prem, hosted and CRM Online (both flavours, Live ID & OSDP/O365).
      • To build the project, you'll need VS2010 and CRM 2011 SDK.
      • It uses late binding and utilises microsoft.xrm.client.dll - make sure to include it.
      • For those living on the edge:  exe is in bin folder. You'll need the usual CRM SDK libraries plus microsoft.xrm.client.dll in the same folder or in GAC.
      • To check your organisation just run
        Georged.FixUR10.exe
      • To fix your organisation
        Georged.FixUR10.exe fix
      • We have reports about dashboards being broken in a similar fashion. Code takes care of them as well.
      • English 1033 only. Search the code for SetLocLabels to add labels in your favourite language.
      • It's a political development, i.e. it strictly follows "No Comments" policy
      • Little bird called logic tells me that charts may be broken as well but I'm yet to come across any. Ping me if after the fix you still get message about LocalizedNames when importing the solution.

    Good luck.

    George


    George Doubinski, MVP http://crm.georged.id.au

    • Proposed as answer by Smeagul65 Wednesday, September 12, 2012 9:02 AM
    • Marked as answer by Jaimie_J Wednesday, September 12, 2012 9:48 AM
    Wednesday, September 12, 2012 12:15 AM
    Moderator
  • Hi!

    Is there some kind of an indication when this hotfix will be available?

    The quick fix util works fine (update the name of a savedquery with querytype 8192 and set to an empty string instead of a null value)


    Wednesday, September 12, 2012 12:22 PM
  • Hi Boudewijn,

    I've got status update regarding the case we've created advising that fix is probably scheduled for UR11. It's not clear when UR11 is coming out, message from support was:  "product team will try to compile the fix solution into the next update which is UR11. Currently, we don't have confirmed schedule for UR11 yet. That will be possibly October."

    I was hoping for a hotfix but here you have it.

    Cheers
    George


    George Doubinski, MVP http://crm.georged.id.au

    Wednesday, September 12, 2012 11:47 PM
    Moderator
  • Thank you very much George!

    your solution Works fine for my environment, and it's in a supported way, so it's perfect.

    Great work and thank you!


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com

    Thursday, September 13, 2012 7:27 AM
  • Thanks George!

    Somehow after we upgraded to rollup 10 (both in dev and acc) we experience problems with the exported solution from dev.

    Somehow rollup 10 creates system views (My ... ) and exports these views without the possibillity for us to even view or deactivate these in the custumizations. Also these views are beging exported to the solution.zip without even being visible in the solution itself. This causes errors on our acc while importing the solution.zip. These views also have a null value in the createdon.

    Is this a related issue? Am I the only one experiencing these problems?

    • Proposed as answer by Smeagul65 Thursday, September 13, 2012 11:50 AM
    Thursday, September 13, 2012 11:14 AM
  • Boudewijn,

    I think you're describing the very issue described here. The views are most likely of type 8192 - offline templates. The code above (make your pick) is designed to fix it.

    Cheers
    George


    George Doubinski, MVP http://crm.georged.id.au

    Thursday, September 13, 2012 11:53 AM
    Moderator
  • Hi George,

    Problem is, the created views by UR 10 appear in the exported managed solution. While importing the managed solution on acc with UR10 an error like below occurs :

    A
    managed solution cannot overwrite the SavedQuery component with Id=7c4e340b-0223-e011-bcea-0e293f99af2a
    which has an unmanaged base instance.  The most likely scenario for this
    error is that an unmanaged solution has installed a new unmanaged SavedQuery
    component on the target system, and now a managed solution from the same
    publisher is trying to install that same SavedQuery component as managed. 
    This will cause an invalid layering of solutions on the target system and is
    not allowed.

    Thursday, September 13, 2012 12:12 PM
  • The resolution is to delete the generated views instead of updating them :)
    Thursday, September 13, 2012 12:16 PM
  • I'd be very careful deleting those views. I'd say delete them in the target system but fix them in the source so that managed solution has those views in it

    George Doubinski, MVP http://crm.georged.id.au

    Thursday, September 13, 2012 12:28 PM
    Moderator
  • Allright then!

    Still it's a bit strange these views appear in the exported solution. There are also views attached (in target) to some system entities and cannot be deleted because of dependencies. So this error still occurs sometimes. Why do they appear in the exported solution?

    Thursday, September 13, 2012 12:39 PM
  • Anyone out there have an MS Support Case # I could reference?  The MS Support team tells me they don't see any other tickets about this in their system and I would like to help them cross reference.

    rick.wilson@outlook.com

    Thanks,

    Rick

    Thursday, September 13, 2012 6:31 PM
  • Hi Rick,

    case 112082809336842.

    Cheers
    George


    George Doubinski, MVP http://crm.georged.id.au

    Thursday, September 13, 2012 8:10 PM
    Moderator
  • Hi Rick,

    my case 112091240594231

    Friday, September 14, 2012 6:21 AM
  • Our case number is 112091753925493.  I included a link to this forum thread in the ticket I submitted.
    Monday, September 17, 2012 3:03 PM
  • In addition, Some saved queries that were disabled in our development environment are incorrectly imported in the test environment. It regards the saved queries that were disabled in the development environment.

    This causes an invalid combination of statecode and statuscode of these deactivated views and throws an error while removing a managed solution.

    The error message: "1 is not a valid status code for state code SavedQueryState.Inactive on savedquery."

    can be solved by enable and disable these views in the test environment.

    DBA's can also use the query below to update the correct statuscodes

    update SavedQuerybase

                    set StatusCode = 2

                    where

                    statecode = 1 and StatusCode <> 2

    Thursday, September 20, 2012 6:55 AM
  • Hi, this is an article (it's in Spanish, sorry), of someone in Microsoft Technical Support that says that today there will re-launch the Rollup 10, that will resolve a lot of incidents, maybe it includes this one. (check the published date)

    The Link: https://community.dynamics.com/product/crm/crmtechnical/b/crmlandia/archive/2012/09/24/rollup-10-se-lanza-de-nuevo.aspx

    i hope this Works! ;)


    Demian Adolfo Raschkovan Blog: http://crmtoall.blogspot.com


    Tuesday, September 25, 2012 2:12 PM
  • The easiest way is to export your customization open the customizations.xml file in VS2010 and validate the xml against the schema.  The .xsd file are in the sdk under sdk\schemas.  The error window will give you a warning about the LocalizedNames element.  Just remove the <savedquery></savedquery> element that has the missing name.

    Tuesday, September 25, 2012 6:48 PM
  • The UR10 packages have been published to the download center.

    http://www.microsoft.com/en-us/download/details.aspx?id=30711.  The new packages has the version  .2740.

    This issue with "Missing LocalizedLabel record for new SavedQuery" is fixed in this UR10.


    Arpita

    Thursday, October 4, 2012 6:25 PM
  • Hi Arpita,

    Thanks for that, do you know if/when the release notes will be made available for this because the KB article link on the page you posted (http://support.microsoft.com/kb/2710577) takes me to the old (2730) release notes.

    Are there any other issues fixed?

    Thanks

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Thursday, October 4, 2012 6:54 PM
  • Hi Rob,

    As of now the Kb hasn't been released and only those issues are fixed which came up in UR10. Thus UR10 kb still is the same but this re-release is for fixing only those issues which came up with UR10.

    e.g:-

    -UR 10 CRM Outlook crashing when configured to use SQL CE 4.0

    - JavaScript editor limited to 2000 characters, can truncate longer scripts

    -Missing LocalizedLabel record for new SavedQuery

    -Update Rollup 10 Quick Find View Query Issue

    -dialogArguments reference in Outlook Client Modal Dialog Causes 3-5MB Memory Leak

    -Unable to add a sales literature to Custom entities

    ]

    but there are a few more.


    Arpita

    Thursday, October 4, 2012 7:37 PM
  • Hi Arpita,

    Thanks for the update and clarification. Do you know when the kb article will be updated with the full list of fixes? Could you confirm whether RU10 2730 must be uninstalled prior to applying 2740?

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Thursday, October 4, 2012 7:47 PM
  • I will update the thread once we get to know when the Kb Article will be released or if it going to be released or not because as of now there is no information around it.

    Also, uninstall the old UR 10 2730 and install 2740 but I would recommend you to do it on test environment first and test all the behaviors before doing it in actual environment.

    Arpita


    Arpita

    Thursday, October 4, 2012 8:03 PM
  • Hi All,

    The above issue is observed with UR 10. I resolve this issue with following steps.

    Open Customization.xml file with visual studio. From schemas section under properties window select the customizatio add customizations file from sdk\schemas folder.

    Now save the file and check for Error's in error window.

    Add the LocalizedNames tag to all places where error has occured.

    Save the file with zip format. And import it again. This will resolve the issue.


    Monday, October 8, 2012 12:13 PM
  • I believe the issue is fixed in UR 10 v2.

    Regards, Donna

    Thursday, October 25, 2012 12:43 PM