创建dynamics CRM client-side (十) - 用JS来获取form type

  

用户可以用以下代码来获取 form type

更多的信息可以查阅https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/getformtype 

        this.formOnLoad = function (executionContext) {
            var formContext = executionContext.getFormContext();

            var formType = formContext.ui.getFormType();

            if (formType == 1) {
                formContext.ui.setFormNotification("User is creating account ", "INFO", "notification1");

            } else if (formType == 2) {
                formContext.ui.setFormNotification("User is opening account", "INFO", "notification1");

            } else if (formType == 3) {
                formContext.ui.setFormNotification("User doesn't have permission to edit the record", "Info", "notification1");
            }
        };

 

创建dynamics CRM client-side (十) - 用JS来获取form type

 

创建dynamics CRM client-side (十) - 用JS来获取form type

 

posted @ 2019-07-09 10:58  TheMiao  阅读(444)  评论(0编辑  收藏  举报