We would like to disable sending emails from a contact form in Dynamics so everyone has to send email through Outlook. We don't want to prevent Dynamics from sending users emails for tasks or workflows though. Is this possible?
We would like to disable sending emails from a contact form in Dynamics so everyone has to send email through Outlook. We don't want to prevent Dynamics from sending users emails for tasks or workflows though. Is this possible?
Hi KDillon,
You could disable email form by javascript:
function disableEmailForm(executionContext) { var formContext = executionContext.getFormContext(); var formType = formContext.ui.getFormType(); // Create new record form type if (formType == 1) { var controls = formContext.ui.controls.get(); for (var i in controls) { var control = controls[i]; if (!control.getDisabled()) { control.setDisabled(true); } } // Hide editor if you don't want see error. formContext.ui.controls.get()[5].setVisible(false); var alertStrings = { confirmButtonLabel: "I know", text: "Please send email by outlook.", title: "Notification" }; var alertOptions = { height: 150, width: 250 }; Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then( function success(result) { console.log("Alert dialog closed"); }, function(error) { console.log(error.message); } ); } }
It will disable all email form fields to prevent user editing it,
even if user click send button, it will show notification that "The email must have at least one recipient before it can be sent."
The only short is that after the editor be disabled, it will display error in editor content,
you could hide it(I've already added) with formContext.ui.controls.get()[5.setVisible(false); .
Regards,
Clofly
Hi KDillon,
I went into the Contact Form and chose to modify the "Social Pane". I included all activities except for the Email activity from the list and it stops me from creating the Email on the form in the Social Pane. I assume it will not show the emails in the list so not sure it does exactly what you would like...
Hope this helps!
Option 1: You can use the Ribbon Workbench to hide the Email button from the Contact Form.
Option 2: You can deactivate the main forms of the email entity, this doesn't affect sending email from workflows. If you do this, you will need to create a new main form (that may be has everything hidden in it except a message saying use outlook please).
None of the above options are perfect but If it was me, I will go with option 1.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156