FormType not returning proper value on Dynamics CRM 2016

给你一囗甜甜゛ 提交于 2019-12-11 04:46:46

问题


In javascript, I have written Xrm.Page.ui.getFormType();.

This code does not work when form is read-only. Even though on the form it is written read-only on the bottom of the record, it is giving me formtype as 2.

even Onload shows formtype 2


回答1:



Edit:

Sounds like a bug in CRM 2016 (v8.2) - credit goes to @Alon in above comment.


I was able to test it quickly, like below.

First scenario: Users' security role don't have Edit/Update privilege for that particular entity record. So the footer says, the record is Active and the form mode is Read only

alert(Xrm.Page.ui.getFormType()); says 3

Second scenario: That particular entity record is deactivated/disabled. So the footer says, the record is Inactive and the form mode is Read only. Applies to completed Activity record too.

alert(Xrm.Page.ui.getFormType()); says 4

On a side note, Xrm.Page is deprecated. Have to re-write them using formContext.

formContext.ui.getFormType();

Read more



来源:https://stackoverflow.com/questions/58754305/formtype-not-returning-proper-value-on-dynamics-crm-2016

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