I have tried to make Enable/Disable user with clear term date in systemuser entity form by using Javascript and written below code.
var ClearTermDate= function () {
var termDate = Xrm.Page.getAttribute("new_termdate");
if (termDate!= null) {
termDate.setValue(null);
}
Xrm.Page.getAttribute("isdisabled").setValue(false);
Xrm.Page.data.entity.save();
};
isdisabled
attribute is not updating. Please suggest code or alternative solution.
Bingo! isdisabled
is Read-only property in systemuser entity per MSDN. You cannot do this in JS directly like you're doing.
You have to follow one of these:
SetStateRequest
in JSSetStateRequest
in JS