web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Disabling sending an email from a contact form

(0) ShareShare
ReportReport
Posted on by 10

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?

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Drew Poggemann Profile Picture
    4 on at

    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...

    Screen-Shot-2019_2D00_10_2D00_30-at-5.03.36-PM.png

    Hope this helps!

  • cloflyMao Profile Picture
    25,210 on at

    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,

    7416.JPG

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans