Answered by:
Stop saving a form using JavaScript, CRM 2013

Question
-
Hi!
I used to useeventObj.getEventArgs().preventDefault();
return false;
in crm 2011 but it does not work in crm 2013 can someone help me? thanksMonday, October 28, 2013 4:12 PM
Answers
-
Hi,
Here is the code for CRM 2013:
function stopSave(context) {
var saveEvt = context.getEventArgs();
if (saveEvt.getSaveMode() == 70) { //Form AutoSave Event
saveEvt.preventDefault();
}
}
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Edited by Minal Dahiya Tuesday, October 29, 2013 11:17 AM
- Proposed as answer by Minal Dahiya Tuesday, October 29, 2013 11:17 AM
- Marked as answer by Andrii ButenkoMVP, Moderator Tuesday, May 24, 2016 10:25 AM
Tuesday, October 29, 2013 11:17 AM -
- Marked as answer by Andrii ButenkoMVP, Moderator Tuesday, May 24, 2016 10:25 AM
Tuesday, October 29, 2013 11:03 AM
All replies
-
- Marked as answer by Andrii ButenkoMVP, Moderator Tuesday, May 24, 2016 10:25 AM
Tuesday, October 29, 2013 11:03 AM -
Hi,
Here is the code for CRM 2013:
function stopSave(context) {
var saveEvt = context.getEventArgs();
if (saveEvt.getSaveMode() == 70) { //Form AutoSave Event
saveEvt.preventDefault();
}
}
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Edited by Minal Dahiya Tuesday, October 29, 2013 11:17 AM
- Proposed as answer by Minal Dahiya Tuesday, October 29, 2013 11:17 AM
- Marked as answer by Andrii ButenkoMVP, Moderator Tuesday, May 24, 2016 10:25 AM
Tuesday, October 29, 2013 11:17 AM