FormType在Dynamics CRM 2016上未返回正确的值 [英] FormType not returning proper value on Dynamics CRM 2016
问题描述
在javascript中,我编写了 Xrm.Page.ui.getFormType();
。
当表单为只读时,此代码不起作用。
即使在窗体的底部将其写为只读,也为我提供了2型。
即使Onload显示为2型
编辑:
在旁边, Xrm.Page
已弃用。必须使用 formContext
重写它们。
formContext.ui。 getFormType();
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
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();
这篇关于FormType在Dynamics CRM 2016上未返回正确的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!