用JavaScript更改readonly的字段

在开发当中会遇到一个readonly的字段, 但是不同的security role会enable当前的readonly字段,并且有相关的security role权限的用户可以编辑.

在CRM中 如果readonly field被更改. 值是不会跟着更改的.  所以我们需要使用 https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/attributes/setsubmitmode

formContext.getAttribute(arg).setSubmitMode("always");

 

posted @ 2020-03-04 16:33  TheMiao  阅读(457)  评论(0编辑  收藏  举报