Hi,
I have one button on ribbon which when clicked sets entity in declined(inactive) state and fill out field "abc" with value "xyz" on form.
if I add Xrm.Page.data.refresh() page refreshes and save dialog comes which I want to avoid.
If I remove Xrm.Page.data.refresh(), I need to refresh the page manually to see if field "abc" is set with value "xyz"
function inactiverecord() {
var terminationControl = Xrm.Page.getControl("abc");
if (terminationControl != null) {
terminationControl.getAttribute().setValue(xyz);
var id = Xrm.Page.data.entity.getId();
Xrm.Page.getAttribute("abc").getSubmitMode("never");
Xrm.Page.data.entity.save();
SetStatus("entity", id, 1, 7720007, function(result) { //set entity declined inactive
}, null, false);
}
}
// Run the failiure management logic and erase failiures from list
var success = manageFailures();
Xrm.Page.data.refresh();
*This post is locked for comments