If you want to control your process on save event, you can use preventDefault method.
1 2 3 4 5 6 7 |
function formOnSave(context) { var saveEvt = context.getEventArgs(); if (Xrm.Page.getAttribute("fieldname").getValue() == null) { saveEvt.preventDefault(); } } |
Dont forget to click “Pass execution context as first parameter” on Form Properties.
preventDefault : Cancels the save operation, but all remaining handlers for the event will still be executed.