Blocking The Events
1 ) function BlockSave(context)
{
var _canSave = Xrm.Page.getAttribute("new_cansave").
getSelectedOption().text;
if(_canSave == "No")
{
Xrm.Page.context.getEventArgs().preventDefault();
}
}
Associate the BlockSave function to the form OnSave event.
Make sure you check the checkbox for Pass execution context
as first parameter.
2) Forcing a Save
Xrm.Page.data.entity.save();
3) Save and New
Xrm.Page.data.entity.save('saveandnew');
4) Save and Close
Xrm.Page.data.entity.save('saveandclose');
No comments:
Post a Comment