Hello, I am trying to check the form Status, if it's set to "Read Only" the fields wouldn't be required.
However if the Status is set to "Create" the field are required and the user is required to put field value.
Thank you so much!
function checkFormStatus() { var type = Xrm.Page.ui.getFormType(); var currentForm = Xrm.Page.ui.formType.getCurrentType(); if (currentForm.getStatus() == "Read Only") Xrm.Page.getAttribute("new_field1").setRequiredLevel("none"); Xrm.Page.getAttribute("new_field2").setRequiredLevel("none"); Xrm.Page.getAttribute("new_field2").setRequiredLevel("none"); }
↧
Checking Form Status onLoad and onChange
↧