Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Add Email Button Not Working (Ribbon Workbench)

(0) ShareShare
ReportReport
Posted on by 1,540

I'm on Dynamics 365 Online.

I want to add an email button to the case ribbon, replicating the one from the social pane. I've obviuosly done something wrong as the button is showing but when I click it's not doing anything.

Here is the xml from Ribbon Workbench

<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance">
  <CustomActions>
    <CustomAction Id="cld.Mscrm.Form.incident.AddEmail.CustomAction" Location="Mscrm.Form.incident.Related.Activities.Controls._children" Sequence="15">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:cld.Mscrm.Form.incident.AddEmail.Alt" Command="Mscrm.SendEmailPrimaryRecord" Id="cld.Mscrm.Form.incident.AddEmail" Image32by32="/_imgs/ribbon/Email_32.png" Image16by16="/_imgs/ribbon/AddEmail_16.png" LabelText="$LocLabels:cld.Mscrm.Form.incident.AddEmail.LabelText" Sequence="15" TemplateAlias="c2" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddEmail_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddEmail" />
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail.CustomAction" Location="Mscrm.Form.incident.MainTab.Save.Controls._children" Sequence="46">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail.Alt" Command="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail" Id="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail" Image32by32="/_imgs/ribbon/Email_32.png" Image16by16="/_imgs/ribbon/AddEmail_16.png" LabelText="$LocLabels:cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail.LabelText" Sequence="46" TemplateAlias="o1" ToolTipTitle="$Resources:Mscrm_Form_Other_Related_Activities_AddEmail_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.AddEmail" />
      </CommandUIDefinition>
    </CustomAction>
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="Mscrm.SendEmailPrimaryRecord">
      <EnableRules>
        <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        <EnableRule Id="Mscrm.AppendToPrimary" />
      </EnableRules>
      <DisplayRules>
        <DisplayRule Id="Mscrm.HideOnCommandBar" />
        <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        <DisplayRule Id="Mscrm.WriteActivityPermission" />
      </DisplayRules>
      <Actions>
        <JavaScriptFunction FunctionName="XrmCore.Commands.Add.AddActivityOnForm" Library="$webresource:Main_system_library.js">
          <StringParameter Value="email" />
        </JavaScriptFunction>
      </Actions>
    </CommandDefinition>
    <CommandDefinition Id="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail">
      <EnableRules>
        <EnableRule Id="Mscrm.FormStateExistingOrReadOnly" />
        <EnableRule Id="Mscrm.AppendToPrimary" />
      </EnableRules>
      <DisplayRules>
        <DisplayRule Id="Mscrm.AddActivityToPrimary" />
        <DisplayRule Id="Mscrm.WriteActivityPermission" />
      </DisplayRules>
      <Actions>
        <JavaScriptFunction FunctionName="XrmCore.Commands.Add.AddActivityOnForm" Library="$webresource:Main_system_library.js">
          <StringParameter Value="email" />
        </JavaScriptFunction>
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules>
      <DisplayRule Id="Mscrm.HideOnCommandBar">
        <OrRule>
          <Or>
            <CommandClientTypeRule Type="Legacy" />
          </Or>
          <Or>
            <PageRule Address="/userdefined/edit.aspx" />
          </Or>
          <Or>
            <PageRule Address="/advancedfind/advfind.aspx" />
          </Or>
          <Or>
            <PageRule Address="/advancedfind/fetchData.aspx" />
          </Or>
          <Or>
            <PageRule Address="/tools/formeditor/formeditor.aspx" />
          </Or>
          <Or>
            <PageRule Address="/tools/visualizationdesigner/visualizationdesigner.aspx" />
          </Or>
        </OrRule>
      </DisplayRule>
      <DisplayRule Id="Mscrm.AddActivityToPrimary">
        <EntityPrivilegeRule PrivilegeType="AppendTo" PrivilegeDepth="Basic" AppliesTo="PrimaryEntity" />
        <EntityPrivilegeRule PrivilegeType="Create" PrivilegeDepth="Basic" EntityName="activitypointer" />
        <EntityPrivilegeRule PrivilegeType="Append" PrivilegeDepth="Basic" EntityName="activitypointer" />
        <EntityPropertyRule AppliesTo="PrimaryEntity" PropertyName="HasActivities" PropertyValue="true" />
      </DisplayRule>
      <DisplayRule Id="Mscrm.WriteActivityPermission">
        <EntityPrivilegeRule PrivilegeType="Write" PrivilegeDepth="Basic" EntityName="activitypointer" />
      </DisplayRule>
    </DisplayRules>
    <EnableRules>
      <EnableRule Id="Mscrm.FormStateExistingOrReadOnly">
        <OrRule>
          <Or>
            <FormStateRule State="ReadOnly" />
          </Or>
          <Or>
            <FormStateRule State="Existing" />
          </Or>
        </OrRule>
      </EnableRule>
      <EnableRule Id="Mscrm.AppendToPrimary">
        <RecordPrivilegeRule PrivilegeType="AppendTo" AppliesTo="PrimaryEntity" />
      </EnableRule>
    </EnableRules>
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="cld.Mscrm.Form.incident.AddEmail.LabelText">
      <Titles>
        <Title description="email" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cld.Mscrm.Form.incident.AddEmail.Alt">
      <Titles>
        <Title description="email" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail.LabelText">
      <Titles>
        <Title description="email" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="cld.incident.Button2.Button.cld.Mscrm.Form.incident.AddEmail.Alt">
      <Titles>
        <Title description="email" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>


*This post is locked for comments

  • Verified answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,615 on at
    RE: Add Email Button Not Working (Ribbon Workbench)

    It’s not recommended to use CRM platform libraries (internal) & repurpose it for our custom buttons. It’s totally unsupported as the future product versions upgrade may break this & will fail silently if they changed.

    But you can mimic the behavior with custom command with the help of JavaScript functions to call openForm method: [View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openform]

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans