Hi
I have a requirement in Dynamics 365 8.2, just to give users an alert before sending an email. When users click on the send email button they want to see an alert are you sure you want to send this email. clicks ok (Yes) email will be sent.
I created a custom send button and using below javascript action instead of updating out of the box button. Send email button uses send() function. I am using this function in my script below. Is this below script is fine or I have to mention the javascript library (/_static/activities/email.js) for send function explicitly?
function EmailSendAlert()
{
//debugger;
Xrm.Utility.confirmDialog("Are you sure you want to send this Email", function(){ send(); },function(){return;});
}
Hi Krish,
As Pravin suggested, you could add your custom confirm dialog to send email by ribbon workbench, below is my process:
Notice: my version is 9.0, but the process would be similar.
1. I recommend you copy OOB SEND button and make customization on copied one.
2. OOB Command name to send email is Mscrm.Form.email.Send, (1)
script is $webresource:Activities/SystemLibraries/Email_main_system_library.js, (2)
function is Activities.EmailCommands.send, (3)
primary control is required. (4) (as executionContext)
3. Copy the OOB command(1),
copy all code inside Email_main_system_library.js(yours might be email.js) to our own web resource, (2)
copy original function name. (3)
4. Let custom Xrm.Utility.confirmDialog surrounds OOB snippet in EmailCommands.send function:
5. Apply OOB display rules to custom button:
6. Save and publish solution in ribbon.
7. Everything work well after I click OK(I didn't hide OOB SEND button in test)
Regards,
Clofly
Hi Krish,
Please refer below url for your reference, I have tried to explain in details. It could help you
Hello,
This should work fine. Have you tried it already?
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102