XRM setDisable() does not work on browsers other than IE

谁说胖子不能爱 提交于 2019-12-24 00:18:49

问题


There’s an error on our XRM form when it is opened from a browser other than IE. You can see the unhelpful message on the image link.

The error is unclear so I debugged it, and it led me to an error on the javascript function on page load. It couldn’t use the XRM setDisabled() function properly:

Xrm.Page.getControl("simpeg_tipelokasi").setDisabled(true);

On IE it works and the field is disabled, but strangely it does not work on Chrome and Firefox. Can you help me figure out why it does not work on those browsers? Thanks a lot!

EDIT:

My bad, it's actually a problem which lies within the ActiveX configuration of both browsers and not on the setDisabled function. I must have missed it when debugging a while ago. See my new post on this url: Alternative to XRM Javascript calling webservice using ActiveX


回答1:


You need to update the roll-up of your organization to at least 12 (the latest at the moment). I'm surprised, though, that you got as far as to actually getting the error. You shouldn't be able to log in and display the "main" forms when using unsupported browser.

EDIT:

It's definitely not an issue with RU12 and browser brand. I just created a new organization and added the following functionality via a web resource.

function disableFullNameOnLoad(){
  Xrm.Page.getControl("fullname").setDisabled(true);
  alert("Full name disabled on load.");
}

function enableFullNameOnSave(){
  Xrm.Page.getControl("fullname").setDisabled(false);
  alert("Full name enabled on save.");
}

As the nomenclature implies, the disabling is performed in the form's onload and enabling in its onsave. I entered the CRM (RU12, OP) using FF, IE and Cr. The behavior was consistent - greyed-out fullname as I open the form and editable when I save it.

So whatever issue there's on your platform, it's not directly related to cross browser incompatibility. Can you check again that you get the discrepancy in behavior between IE and FF when you add the exact code from my examples, connected to the events exactly the way I described, please.




回答2:


Try using XrmServiceToolKit new version which should support cross browser compatibility:

http://xrmservicetoolkit.codeplex.com/




回答3:


If you are not currently on Rollup 12 then Chrome is not supported officially.

If you can, then I would try and upgrade to get the new cross browser support offered via Rollup 12. Make sure you check out the code validation tool to make sure your code and customizations don't have any issues.

If this isn't an option then you can try the xrmservicetoolkit which is a CRM JavaScript library.



来源:https://stackoverflow.com/questions/15539724/xrm-setdisable-does-not-work-on-browsers-other-than-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!