且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

XRM setDisable()在IE以外的浏览器上不起作用

更新时间:2023-01-24 11:22:57

您需要更新组织的汇总至少12(目前是最新的)。不过,我很惊讶,你竟然得到了错误。在使用不受支持的浏览器时,您应该无法登录并显示主要表单。
$ b 编辑:

确实

不是RU12和浏览器品牌的问题。我只是创建了一个新的组织,并通过一个web资源添加了以下功能。


$ b function disableFullNameOnLoad ){
Xrm.Page.getControl(fullname)。setDisabled(true);
alert(加载时禁用全名);


function enableFullNameOnSave(){
Xrm.Page.getControl(fullname)。setDisabled(false);
alert(在保存时启用全名);





$ b

正如命名所暗示的,禁用是在窗体的 并在其 onsave 中启用。我使用FF,IE和Cr​​进入了CRM(RU12,OP)。行为是一致的 - 当我保存它时打开表单和可编辑的 全名 。因此,无论您的平台上有什么问题,都不会与跨浏览器不兼容性直接相关。你可以再次检查一下你是否在IE和FF之间的行为差​​异,当你添加我的例子中的确切代码,请按照我所描述的方式连接到事件。


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

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.