This is the function I am calling onChange of fieldtext attribute. But the Save function is not working and it always shows me a pop up
Your changes have not been saved. To stay on the page so that you can save your changes, click Cancel.
function savefields(executionContext, fieldtext, setfieldtext) {
var formContext = executionContext.getFormContext();
var id = formContext.data.entity.getId();
var entity = formContext.data.entity.getEntityName();
if (executionContext != null) {
if (formContext.getAttribute(fieldtext).getValue() != null) {
formContext.getAttribute(setfieldtext).setValue(1);
Xrm.Page.getAttribute(setfieldtext).setSubmitMode("always");
formContext.data.entity.save();
//Xrm.Page.data.entity.refresh();
Xrm.Utility.openEntityForm(entity, id);
}
}
}