将 onchange 事件添加到“锁定”事件中 Dynamics CRM 4 中的字段
我正在自定义 Dynamics CRM 4,并希望修改案例实体的表单,以将一些 JavaScript 添加到知识库文章查找字段 (kbarticleid_ledit) 的 onchange 事件中。 但是,当我单击该字段的“更改属性”时,我收到一条错误消息:
此字段属于锁定部分,无法修改其属性。
如何解决此问题并对其进行编辑? 是否有类似于自定义文章视图的解决方法? 或者我可以以某种方式破解数据库来“解锁”该字段吗?
I'm customising Dynamics CRM 4 and would like to modify the Form for the Case entity to add some JavaScript to the onchange event for the Knowledge Base Article lookup field (kbarticleid_ledit). However, when I click Change Properties for that field I get an error message:
This field belongs to a locked section and cannot have its properties modified.
How can I get around this and edit it? Is there a workaround similar to customizing the Article view? Or can I hack the DB somehow to "unlock" that field?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以从 onload 事件添加 onchange 代码。 例如,如果锁定字段的 id 是lockedField,则可以执行类似的操作。
You could also have added onchange code from the onload event. For example, if the locked field's id was lockedField, you could do something like this.
好吧,我想通了 - 在这里发布以防其他人遇到同样的问题。 您需要将 Case 实体的自定义导出到 XML 并编辑该 XML。 您可以通过在 XML 中查找相应元素并将属性 locklevel="1" 更改为 locklevel="0" 来“解锁”该部分。
但是,解锁它并不能帮助我编辑 onchange 事件代码。 CRM 已经有一些该事件的代码,当我在 UI 中添加代码时,它向 XML 添加了第二个“onchange”事件! 因此,我被迫手动编辑 XML 中的代码(当然,使用正确的 XML 编码),然后重新导入并发布自定义内容。
OK, I figured it out - posting here in case anyone else runs into the same problem. You need to export the customizations for the Case entity to XML and edit the XML. You can "unlock" the section by finding the corresponding element in the XML and changing the attribute locklevel="1" to locklevel="0".
However, unlocking it didn't help me in editing the onchange event code. CRM already had some code for that event and when I added my code in the UI it added a second "onchange" event to the XML! So I was forced to manually edit the code in the XML (with proper XML-encoding, of course) and then re-import and publish the customizations.