web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer Service forum

Issue with Command Bar + IE 11

(0) ShareShare
ReportReport
Posted on by

After updating to v9, we are running into some issues for IE11 users. Our solution contains a custom button on the command bar for the case entity. This button is no longer working with IE11 after the update. It is working as intended in Chrome, Firefox, and Edge.

We have a custom command with javascript connected to this button, but this javascript doesn't appear to be reached in IE11. I tested this by adding the debugger; keyword to the top of the command method... debugger does not hit the breakpoint. Not even when all other code in the method is commented out.

Has anyone ran into similar issues with IE11? Please let me know if you have!

Categories:
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    have you tried to

    1. clear the cache.

    2. run in private mode

    3. update the browser into latest version ,

    4. try in different machines

    5. write a simple alert JS and try to see if this work.

    share your code here.

  • Arun Vinoth Profile Picture
    11,615 Moderator on at

    IE (including IE11) is not a modern browser, only Edge, Chrome, Firefox are. Hence some of the code may break based on your script code standard ie ES6 or ES5 standards

    Open browser developer toolbar (F12) to see any error in console.

    Yes, we are facing lot of script issues in IE. We have workarounds, which we can recommend after seeing your code.

  • Clayton Fetzer Profile Picture
    on at

    I have tried all of the above. My WebResource code is below. The customized button is hooked up to the ribbon_ResolveCaseScript function. I'd like to re-iterate that the debugger method is not hit in IE 11.

    var MyCompany= MyCompany || {};
    MyCompany.Crm = MyCompany.Crm || {};
    MyCompany.Crm.Entities = MyCompany.Crm.Entities || {};
    Type.registerNamespace("Mscrm");
    Mscrm.CustomActions = function () { };
    Mscrm.CustomUtilities = function () { };
    Mscrm.CustomUtilities.DialogConfirmStrings = function () { };
    
    (function () {
        "use strict";
        MyCompany.Crm.Entities.Case = {
            DAYS_TO_INITIAL_LETTER_SENT: "new_daystoinitiallettersent",
            DAYS_TO_RESOLUTION: "new_daystoresolved",
            DATE_CASE_OPENED: "myc_datecaseopened",
            INITIAL_LETTER_SENT: "myc_actualinitialresolutiondate",
            FINAL_LETTER_SENT: "myc_actualfinalresolutiondate",
            RESOLVED_IN_20_BUSINESS_DAYS: "myc_resolvedin20businessdays",
            TWENTY_BUSINESS_DAYS: "myc_targetresolution20businessdaysdate",
            DATE_OPENED: "myc_datecaseopened",
            ribbonClose: false,
            STATE_CODE: "statecode",
            STATE_CODE_RESOLVED: 1,
            STATE_CODE_CANCELED: 2,
            STATUS_CODE: "statuscode",
            STATUS_CODE_CLOSED: 854980008,
            STATUS_CODE_PROBLEM_RESOLVED: 5,
            STATUS_CODE_NOTIFIED_DEPARTMENT: 854980009,
            STATUS_CODE_NO_IMMEDIATE_ACTION_REQUIRED: 854980010,
            CASE_LOGICALNAME: "incident",
            RESOLVED_ON: "myc_resolvedon",
            RESOLUTION_TYPE: "myc_resolutiontype",
            RESOLUTION_TYPE_PROBLEM_RESOLVED: 854980000,
            RESOLUTION_TYPE_NOTIFIED_DEPARTMENT: 854980001,
            RESOLUTION_TYPE_NO_IMMEDIATE_ACTION_REQUIRED: 854980002,
    
            ribbon_ResolveCaseScript: function () {
                debugger;
                me.ribbonClose = true;
                var recordId = Xrm.Page.data.entity.getId().replace(/[{}]/g, "");
                var resolutionValue = Xrm.Page.getAttribute(me.RESOLUTION_TYPE).getValue();
                Xrm.Page.getAttribute(me.RESOLVED_ON).setValue(new Date());
                Xrm.Page.data.entity.save();
                var completedStatusUpdate = null;
    
                if (resolutionValue === me.RESOLUTION_TYPE_PROBLEM_RESOLVED) {
                    completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_PROBLEM_RESOLVED);
                }
                else if (resolutionValue === me.RESOLUTION_TYPE_NOTIFIED_DEPARTMENT) {
                    completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_NOTIFIED_DEPARTMENT);
                }
                else if (resolutionValue === me.RESOLUTION_TYPE_NO_IMMEDIATE_ACTION_REQUIRED) {
                    completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_NO_IMMEDIATE_ACTION_REQUIRED);
                }
                else {
                    completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_CLOSED);
                }
            },      
    
            changeRecordStatus: function (EntityLogicalName, RECORD_ID, stateCode, statusCode) {
                // create the SetState request
                var request = 
                `<?xml version="1.0" encoding="UTF-8"?>
                    <s:Envelope xmlns:s="schemas.xmlsoap.org/.../envelope">
                       <s:Body>
                          <Execute xmlns="schemas.microsoft.com/.../Services" xmlns:i="www.w3.org/.../XMLSchema-instance">
                             <request xmlns:a="schemas.microsoft.com/.../Contracts" xmlns:b="schemas.microsoft.com/.../Contracts" i:type="b:CloseIncidentRequest">
                                <a:Parameters xmlns:c="schemas.datacontract.org/.../System.Collections.Generic">
                                   <a:KeyValuePairOfstringanyType>
                                      <c:key>IncidentResolution</c:key>
                                      <c:value i:type="a:Entity">
                                         <a:Attributes>
                                            <a:KeyValuePairOfstringanyType>
                                               <c:key>` + EntityLogicalName + `id</c:key>
                                               <c:value i:type="a:EntityReference">
                                                  <a:Id>` + RECORD_ID + `</a:Id>
                                                  <a:LogicalName>` + EntityLogicalName + `</a:LogicalName>
                                                  <a:Name i:nil="true" />
                                               </c:value>
                                            </a:KeyValuePairOfstringanyType>
                                            <a:KeyValuePairOfstringanyType>
                                               <c:key>subject</c:key>
                                               <c:value xmlns:d="www.w3.org/.../XMLSchema" i:type="d:string">Closed</c:value>
                                            </a:KeyValuePairOfstringanyType>
                                         </a:Attributes>
                                         <a:EntityState i:nil="true" />
                                         <a:FormattedValues />
                                         <a:Id>00000000-0000-0000-0000-000000000000</a:Id>
                                         <a:LogicalName>incidentresolution</a:LogicalName>
                                         <a:RelatedEntities />
                                      </c:value>
                                   </a:KeyValuePairOfstringanyType>
                                   <a:KeyValuePairOfstringanyType>
                                      <c:key>Status</c:key>
                                      <c:value i:type="a:OptionSetValue">
                                         <a:Value>` + statusCode + `</a:Value>
                                      </c:value>
                                   </a:KeyValuePairOfstringanyType>
                                </a:Parameters>
                                <a:RequestId i:nil="true" />
                                <a:RequestName>CloseIncident</a:RequestName>
                             </request>
                          </Execute>
                       </s:Body>
                    </s:Envelope>`;
                
                //send set state request
                return parent.$.ajax({
                    type: "POST",
                    contentType: "text/xml; charset=utf-8",
                    datatype: "xml",
                    url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/Organization.svc/web",
                    data: request,
                    beforeSend: function (XMLHttpRequest) {
                        XMLHttpRequest.setRequestHeader("Accept", "application/xml, text/xml, */*");
                        XMLHttpRequest.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute");
                    },
                    success: function (data, textStatus, XmlHttpRequest) {
                        Xrm.Page.data.refresh(); // refresh current crm form
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert(errorThrown);
                    }
                });
            }
        };
        var me = MyCompany.Crm.Entities.Case;
    }).call(this);
    


  • Clayton Fetzer Profile Picture
    on at

    Thanks for the attention! I have tried all these already.

    A shortened version of my WebResource code is below. The customized button is hooked up to the ribbon_ResolveCaseScript function.

    var MyCompany= MyCompany || {};

    MyCompany.Crm = MyCompany.Crm || {};

    MyCompany.Crm.Entities = MyCompany.Crm.Entities || {};

    Type.registerNamespace("Mscrm");

    Mscrm.CustomActions = function () { };

    Mscrm.CustomUtilities = function () { };

    Mscrm.CustomUtilities.DialogConfirmStrings = function () { };

    (function () {

       "use strict";

       MyCompany.Crm.Entities.Case = {

           DAYS_TO_INITIAL_LETTER_SENT: "new_daystoinitiallettersent",

           DAYS_TO_RESOLUTION: "new_daystoresolved",

           DATE_CASE_OPENED: "myc_datecaseopened",

           INITIAL_LETTER_SENT: "myc_actualinitialresolutiondate",

           FINAL_LETTER_SENT: "myc_actualfinalresolutiondate",

           RESOLVED_IN_20_BUSINESS_DAYS: "myc_resolvedin20businessdays",

           TWENTY_BUSINESS_DAYS: "myc_targetresolution20businessdaysdate",

           DATE_OPENED: "myc_datecaseopened",

           ribbonClose: false,

           STATE_CODE: "statecode",

           STATE_CODE_RESOLVED: 1,

           STATE_CODE_CANCELED: 2,

           STATUS_CODE: "statuscode",

           STATUS_CODE_CLOSED: 854980008,

           STATUS_CODE_PROBLEM_RESOLVED: 5,

           STATUS_CODE_NOTIFIED_DEPARTMENT: 854980009,

           STATUS_CODE_NO_IMMEDIATE_ACTION_REQUIRED: 854980010,

           CASE_LOGICALNAME: "incident",

           RESOLVED_ON: "myc_resolvedon",

           RESOLUTION_TYPE: "myc_resolutiontype",

           RESOLUTION_TYPE_PROBLEM_RESOLVED: 854980000,

           RESOLUTION_TYPE_NOTIFIED_DEPARTMENT: 854980001,

           RESOLUTION_TYPE_NO_IMMEDIATE_ACTION_REQUIRED: 854980002,

           ribbon_ResolveCaseScript: function () {

               debugger;

               me.ribbonClose = true;

               var recordId = Xrm.Page.data.entity.getId().replace(/[{}]/g, "");

               var resolutionValue = Xrm.Page.getAttribute(me.RESOLUTION_TYPE).getValue();

               Xrm.Page.getAttribute(me.RESOLVED_ON).setValue(new Date());

               Xrm.Page.data.entity.save();

               var completedStatusUpdate = null;

               if (resolutionValue === me.RESOLUTION_TYPE_PROBLEM_RESOLVED) {

                   completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_PROBLEM_RESOLVED);

               }

               else if (resolutionValue === me.RESOLUTION_TYPE_NOTIFIED_DEPARTMENT) {

                   completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_NOTIFIED_DEPARTMENT);

               }

               else if (resolutionValue === me.RESOLUTION_TYPE_NO_IMMEDIATE_ACTION_REQUIRED) {

                   completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_NO_IMMEDIATE_ACTION_REQUIRED);

               }

               else {

                   completedStatusUpdate = me.changeRecordStatus(me.CASE_LOGICALNAME, recordId, me.STATE_CODE_RESOLVED, me.STATUS_CODE_CLOSED);

               }

           },      

           changeRecordStatus: function (EntityLogicalName, RECORD_ID, stateCode, statusCode) {

               // create the SetState request

               var request =

               `<?xml version="1.0" encoding="UTF-8"?>

                   <s:Envelope xmlns:s="schemas.xmlsoap.org/.../&quot;>

                      <s:Body>

                         <Execute xmlns="schemas.microsoft.com/.../Services&quot; xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

                            <request xmlns:a="schemas.microsoft.com/.../Contracts&quot; xmlns:b="schemas.microsoft.com/.../Contracts&quot; i:type="b:CloseIncidentRequest">

                               <a:Parameters xmlns:c="schemas.datacontract.org/.../System.Collections.Generic&quot;>

                                  <a:KeyValuePairOfstringanyType>

                                     <c:key>IncidentResolution</c:key>

                                     <c:value i:type="a:Entity">

                                        <a:Attributes>

                                           <a:KeyValuePairOfstringanyType>

                                              <c:key>` + EntityLogicalName + `id</c:key>

                                              <c:value i:type="a:EntityReference">

                                                 <a:Id>` + RECORD_ID + `</a:Id>

                                                 <a:LogicalName>` + EntityLogicalName + `</a:LogicalName>

                                                 <a:Name i:nil="true" />

                                              </c:value>

                                           </a:KeyValuePairOfstringanyType>

                                           <a:KeyValuePairOfstringanyType>

                                              <c:key>subject</c:key>

                                              <c:value xmlns:d="www.w3.org/.../XMLSchema&quot; i:type="d:string">Closed</c:value>

                                           </a:KeyValuePairOfstringanyType>

                                        </a:Attributes>

                                        <a:EntityState i:nil="true" />

                                        <a:FormattedValues />

                                        <a:Id>00000000-0000-0000-0000-000000000000</a:Id>

                                        <a:LogicalName>incidentresolution</a:LogicalName>

                                        <a:RelatedEntities />

                                     </c:value>

                                  </a:KeyValuePairOfstringanyType>

                                  <a:KeyValuePairOfstringanyType>

                                     <c:key>Status</c:key>

                                     <c:value i:type="a:OptionSetValue">

                                        <a:Value>` + statusCode + `</a:Value>

                                     </c:value>

                                  </a:KeyValuePairOfstringanyType>

                               </a:Parameters>

                               <a:RequestId i:nil="true" />

                               <a:RequestName>CloseIncident</a:RequestName>

                            </request>

                         </Execute>

                      </s:Body>

                   </s:Envelope>`;

               //send set state request

               return parent.$.ajax({

                   type: "POST",

                   contentType: "text/xml; charset=utf-8",

                   datatype: "xml",

                   url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/Organization.svc/web",

                   data: request,

                   beforeSend: function (XMLHttpRequest) {

                       XMLHttpRequest.setRequestHeader("Accept", "application/xml, text/xml, */*");

                       XMLHttpRequest.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute&quot;);

                   },

                   success: function (data, textStatus, XmlHttpRequest) {

                       Xrm.Page.data.refresh(); // refresh current crm form

                   },

                   error: function (XMLHttpRequest, textStatus, errorThrown) {

                       alert(errorThrown);

                   }

               });

           }

       };

       var me = MyCompany.Crm.Entities.Case;

    }).call(this);

  • Clayton Fetzer Profile Picture
    on at

    Please ignore duplicate reply, as form did not give notification that submission was successful

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans