Hi,
I am trying to prevent CRM 2011 default CRM form events of Save & Close and Save & New.
On Save & Close, I need to make form wait for 3 seconds and force close the form after 3 seconds.For this purpose, i used SeTimeout function to execute Xrm.Form.Ui.Close() function after 3 seconds
But with this method, the problem i am having is Xrm.Form.Ui.Close() function behaves as windlow.close which ask for a pop up every time on save & close whether to save or discard my changes.
So, I used the below code:
if (context.getEventArgs().getSaveMode() == 2) {
context.getEventArgs().preventDefault();
setTimeout(function () {
Xrm.Page.data.entity.save('saveandclose');
}, 3000);
}
But it is not closing my form. Can you please suggest any alternative for this problem.
Thanks.
*This post is locked for comments
I have the same question (0)