FormType在Dynamics CRM 2016上未返回正确的值 [英] FormType not returning proper value on Dynamics CRM 2016

查看:116
本文介绍了FormType在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();

Read more

这篇关于FormType在Dynamics CRM 2016上未返回正确的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆