I am updating some old code from xrm page to form context, and in the javascript I keep finding statements to set a field to required.
Xrm.Page.getAttribute("new_myfield").setRequiredLevel("required");
formContext.getAttribute("new_myfield ").setRequiredLevel("required");
Is there any reason it is better to set fields to required in JavaScript and not to set the field to required in the solution?