Hi!
I've added a function to the onsave event in MSCRM which is supposed to check the save method and do some stuff if the email is sent.
According to Microsoft's documentation it should be possible to get this from the execution context on save (value = 7):
https://msdn.microsoft.com/en-us/library/gg509060.aspx
I've written the following javascript function which I've added both to the onsave-method in the form properties as well as using the addOnSave() method:
doStuffOnSend = function(context) { var args = context.getEventArgs(); console.log(args.getSaveMode()); // Always prints 1 if (args.getSaveMode() === 7) { console.log("This never executes"); } }
I've tried on CRM2016 RTM as well as Dynamics365 (on-premises)
*This post is locked for comments