I used some javascript to set a date and it works when a new form is opened but when the form is saved it allows the user to change the date to earlier than the set date by the JavaScript.
Is there something that I have to add to the JavaScript to make sure this field cannot be changed once the form has been saved?
function SetDate()
{
if(Xrm.Page.ui.getFormType() == 1)
{
var dueDate = Xrm.Page.data.entity.attributes.get("new_date"); // Field used is Date on XXX Form
var now = new Date();
var endDate = new Date().setDate(now.getDate()+3); // Set Date to Today + 3 Days
dueDate.setValue(endDate);
}
}
Thanks!