Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Send Email for report Dynamics 365 Online

Posted on by 460

Hi,

I already create custom report and upload in Dynamics 365 online.

the next is to execute the report automatically and send the result through email to certain people.

in CRM On Premise, there is a ribbon named "Schedulled Report", and this ribbon is not available in CRM Online.

any suggestion to do this on CRM Online?

I already saw for the workflow, but, still not working.

*This post is locked for comments

  • xcode17 Profile Picture
    xcode17 460 on at
    RE: Send Email for report Dynamics 365 Online

    Check below for my code.

  • Verified answer
    xcode17 Profile Picture
    xcode17 460 on at
    RE: Send Email for report Dynamics 365 Online

    Hi Wikky and Kate,

    at the first, I'm declare all the information from my email server

    StringBuilder EmailMessage = new StringBuilder();
    string emailTo = string.Empty; string emailFrom = string.Empty; string IBIZUser = "xxx@domain.com"; string IBIZPassword = "xxxxxx"; int IBIZPort = xxx; string IBIZHost = "xxxxxx"; string IBIZSubject = "CRM Daily Report - " + DateTime.Now.ToString("dd MMMM yyyy");


    then, I retrieve all the data using queryexperresion (fetchXML). after receive the data, put it on the emailmessage

    if (resultCRMCRFCase.Entities.Any())
                {
                    EmailMessage.Append(TableData(resultCRMCRFCase, orgService));
                }
                EmailMessage.AppendLine("");


    then, start send the email

    MailMessage IbizEmail = new MailMessage();
                SmtpClient Client = new SmtpClient();
                Client.Port = IBIZPort;
                Client.Host = IBIZHost;
                Client.EnableSsl = true;
                Client.Credentials = new NetworkCredential(IBIZUser, IBIZPassword);
                IbizEmail.From = new MailAddress(IBIZUser);
                IbizEmail.To.Add("mail@domain.com");
                IbizEmail.CC.Add("mailcc@domain.com");
                IbizEmail.Subject = IBIZSubject;
                IbizEmail.Body = EmailMessage.ToString();
                IbizEmail.IsBodyHtml = true;
                Client.Send(IbizEmail);


    only like that. hope it will help you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Send Email for report Dynamics 365 Online

    Hi Denis,

    Could you share your console solution, please?

    Thank you in advance.

  • wikky2007 Profile Picture
    wikky2007 40 on at
    RE: Send Email for report Dynamics 365 Online

    Denis--do you mind sharing your console solution? I think it would be beneficial for many others since this is a common request. Thanks

  • Verified answer
    xcode17 Profile Picture
    xcode17 460 on at
    RE: Send Email for report Dynamics 365 Online

    Thanks Azwar.

    Finally, I'm able to do this, by creating console to retrieve the data from 365, then send the email.

  • Suggested answer
    M.Azwar Alam Profile Picture
    M.Azwar Alam on at
    RE: Send Email for report Dynamics 365 Online

    Hi,

    You can check below thread

    https://community.dynamics.com/crm/f/117/t/219580

    Mark as verified, if it works for you

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans