Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Email entity in solution

Posted on by 1,217

Hi All,

I was trying to add the standard email entity into my solution, however when I select existing entity and filter email, there is no Email entity listed. Is that limitation?

email-activity-in-solution.jpg

Thanks.

Regards,

Teh

  • YA TEH Profile Picture
    YA TEH 1,217 on at
    RE: Email entity in solution

    Hi Clofly,

    Thanks, will try it out later.

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Email entity in solution

    Hi Teh,

    Before raising a ticket, 

    you could run SDK to try to add email entity to your solution manually to test whether it could work.

    using Microsoft.Crm.Sdk.Messages;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Client;
    using Microsoft.Xrm.Sdk.Messages;
    using Microsoft.Xrm.Sdk.Metadata;
    using Microsoft.Xrm.Sdk.Query;
    using System;
    using System.Diagnostics;
    using System.Net;
    using System.ServiceModel;
    using System.ServiceModel.Description;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections.Generic;
    using System.IO;
    
    namespace ConnectionForD365
    {
        class Program
        {
    
            static void Main(string[] args)
            {
                connectToCRMByOrg();
            }
    
            public static void connectToCRMByOrg()
            {
                IOrganizationService organizationService = null;
    
                try
                {
                    String username = "";
                    String password = "";
                    String organizationUrl = "";               
                    ClientCredentials clientCredentials = new ClientCredentials();
                    clientCredentials.UserName.UserName = username;
                    clientCredentials.UserName.Password = password;
    
                    // For Dynamics 365 Customer Engagement V9.X, set Security Protocol as TLS12
                    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                    // Get the URL from CRM, Navigate to Settings -> Customizations -> Developer Resources
                    // Copy and Paste Organization Service Endpoint Address URL
                    Console.WriteLine("Please waiting for connection...");
                    organizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri(organizationUrl),
                   
                     null, clientCredentials, null);
    
                    if (organizationService != null)
                    {
                        Guid userid = ((WhoAmIResponse)organizationService.Execute(new WhoAmIRequest())).UserId;
    
                        if (userid != Guid.Empty)
                        {
                            Console.WriteLine("Connection Established Successfully...");
    
                            OrganizationServiceProxy _serviceProxy = (OrganizationServiceProxy)organizationService;
    
                            _serviceProxy.EnableProxyTypes();
    
                            RetrieveEntityRequest addEntity = new RetrieveEntityRequest()
                            {
                                LogicalName = "email"
                            };
                            RetrieveEntityResponse retrieveAddEntityResponse = (RetrieveEntityResponse)_serviceProxy.Execute(addEntity);
                            AddSolutionComponentRequest addReq = new AddSolutionComponentRequest()
                            {
                                ComponentType = 1,
                                ComponentId = (Guid)retrieveAddEntityResponse.EntityMetadata.MetadataId,
                                // replace it with your solution name
                                SolutionUniqueName = "testsolution"
                            };
                            _serviceProxy.Execute(addReq);
    
                            Console.WriteLine("OK");
    
                        }
                    }
                    else
                    {
                        Console.WriteLine("Failed to Established Connection!!!");
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception caught - "   ex.Message);
                }
            }
    
        }
    }

    Just create a new console app and import necessary Dynamics 365 SDK libraries,

    then copy full code to run.(replace SolutionUniqueName parameter value with your owns)

    Result:

    I added Email entity into my "testsolution" with above code.

    pastedimage1584083090844v1.png

    Please follow this tutorial for how to connect to your D365:

    https://arunpotti.wordpress.com/2018/02/03/step-by-step-to-connect-dynamics-365-crm-online-v9-x-using-c-console-application/

    If even code not works, then raise a tk for assistance.

    Regards,

    Clofly

  • Suggested answer
    RE: Email entity in solution

    Hi Teh,

    Thanks for the details. We would need more details to investigate this further.

    Please open a support ticket for investigation.

    Thanks,

    Mustafa

  • YA TEH Profile Picture
    YA TEH 1,217 on at
    RE: Email entity in solution

    Hi Mustafa,

    There is result return by using the url you given. The email entity is in the list of entities in powerapps, but when I try to add into my solution I can't find it.

    Thanks.

    Regards,

    Teh

  • YA TEH Profile Picture
    YA TEH 1,217 on at
    RE: Email entity in solution

    Hi Clofly,

    Yes, I can send email successfully from there.

    Thanks.

    Regards,

    Teh

  • Suggested answer
    RE: Email entity in solution

    Hello,

    The email entity should be present in the org. Could you please try to run this Odata query to verify the same.

    https://<Orgurl>/api/data/v9.1//EntityDefinitions(95ae88b3-cc0c-45ac-a2db-655dceec238b)

    If you don't get any results, you may have to open a support ticket with Microsoft for further investigation.

    Thank you.

    Mustafa Sabir

    Support Engineer- Dynamics 365 CE

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Email entity in solution

    Hi Teh,

    Sorry for not so clear description, my "sales app" could stands for your "Sales hub".

    1. If you can see Sales hub, there is a small label "WEB" at bottom of app block.

    pastedimage1584004087760v1.png

    2. check whether contact records could match to records in marketing application

    pastedimage1584004323833v3.png

    3. open the app and click the Activities to check whether you can see Email button

    pastedimage1584004343285v4.png

    4. try to send an email to test whether email module works.

    Regards,

    Clofly

  • YA TEH Profile Picture
    YA TEH 1,217 on at
    RE: Email entity in solution

    Hi Clofly,

    Yes, my user ID is system administrator. Seem like I cannot find email entity in classic view as well....

    Our company D365 is full application, I dont see the Sales app itself, but I saw Sales hub.

    Regards,

    Teh

  • cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Email entity in solution

    Hi Teh,

    * Is your current user system administrator?

    * Can you find Email entity in classical UI?

    pastedimage1584002797109v1.png

    * In your instance which has marketing application, does sales application also exist?

    pastedimage1584002897902v2.png

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans