Hello, Guys, I have this script that sets a field required if another field value == submit, I debugged it and var field is equal submit, but the resolution field does not become required right a away it only becomes required when you save the record
don't know what I am doing wrong need some help and feedback
function setRequired()
{
// Access the field on the form
var field = Xrm.Page.data.entity.attributes.get("new_reportstatus").getText();
if(field == "Submit")
{
Xrm.Page.getAttribute("new_resolution").setRequiredLevel("required");
}
else
{
Xrm.Page.getAttribute("new_resolution").setRequiredLevel("none");
}
}