9

I have been on a CRM 2011 project that uses a lot of custom views.

I recently figured it out that all lookup custom views are only working properly in the internet explorer. When I try using google chrome (Version 51.0.2704.84 m) it simple does not work.

I googled without luck.

Is anyone aware about how to solve that issue?

I'm sure many of you have faced the same problem.

Here is my code. I emphasize that it works like a charm in IE.

    var viewId = "{1DFB2B35-B07C-44D1-868D-258DEEAB88E1}";
    var entityName = "tz_tipodefrete";
    var viewDisplayName = "Tipos de Frete Disponíveis";

    var fetchXml =
"<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
    "<entity name='tz_tipodefrete'>" +
        "<attribute name='tz_name'/>" +
        "<order descending='false' attribute='tz_ordem'/>" +
        "<filter type='and'>";
    if (filtrar)
        fetchXml = fetchXml + "<condition attribute='tz_name' value='Cliente Retira e instala no CT' operator='ne'/>";

    fetchXml = fetchXml +
            "<condition attribute='statecode' value='0' operator='eq'/>" +
        "</filter>" +
    "</entity>" +
"</fetch>";

    // build Grid Layout
    var layoutXml = "<grid name='resultset' object='1' jump='tz_name' select='1' icon='1' preview='1'>" +
                      "<row name='result' id='tz_tipodefreteid'>" +
                        "<cell name='tz_name' width='600' />" +
                      "</row>" +
                    "</grid>";


    Xrm.Page.getControl("tz_tipodefrete").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);
    //Desabilita a opção do usuário trocar de view. Provável que pare de funcionar na migração para versão 2015
    document.getElementById("tz_tipodefrete").setAttribute("disableViewPicker", "1");
jasonscript
  • 5,189
  • 1
  • 23
  • 39
Bruno Willian
  • 240
  • 3
  • 18
  • 1
    Check to make sure your combination of versions and OS are supported. https://support.microsoft.com/en-us/kb/2784954 Also, CRM had issues for a long time on Chrome with dialogs, lookups included. I don't know if it's been fixed yet, but here's the kb article about it: https://support.microsoft.com/en-us/kb/3008160 – Polshgiant Jun 10 '16 at 23:30
  • 1
    Do you get any errors in the developer console (F12) when trying to run the form? – jasonscript Jun 13 '16 at 02:26
  • I don't get any error, it simply doesn't work. – Bruno Willian Jun 13 '16 at 12:32
  • Polshgiant, I'm using the latest chrome version, I saw the post about browser compatibility, I am using windows 7 along with chrome latest version, so it was supossed to be working properly. – Bruno Willian Jun 13 '16 at 12:40

1 Answers1

1

Have you tried taking the brackets off the guid? Ex. var viewId = "1DFB2B35-B07C-44D1-868D-258DEEAB88E1"; In some situations, that helps.

Sarah_B
  • 11
  • 1