Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Checking Form Status onLoad and onChange

$
0
0
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"); }

Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>