创建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_第1张图片

 

创建dynamics CRM client-side (十) - 用JS来获取form type_第2张图片

 

你可能感兴趣的:(创建dynamics CRM client-side (十) - 用JS来获取form type)