Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Send email and attach excel file - complex task!!

Posted on by Microsoft Employee

Hey guys,

I have very complex task, and don't know if it's even possible to do it...

I have view of Service Activities (filtered by day), and I need to export that view in excel and send that excel file to email. And what's more, that should be done automaticaly on 6pm every day!

The other option if it's not possible to be scheduled, I should make custom button and on click send email with atached excel file.

The only thing I know is that I should probably make custom workflow, but if somebody have done something similar to this, please help :-).

p.s. it's CRM 2016 on-premise

*This post is locked for comments

  • Suggested answer
    Temmy Wahyu Raharjo Profile Picture
    Temmy Wahyu Raharjo 2,914 on at
    RE: Send email and attach excel file - complex task!!

    I do agree with Pawel. Do it in console application, then trigger it using Windows Task can be more easier to do. There is no limitation.

    For your reference:

    https://msdn.microsoft.com/en-us/library/hh210217.aspx

    https://msdn.microsoft.com/en-us/library/gg328344.aspx?f=255&MSPPError=-2147217396

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: Send email and attach excel file - complex task!!

    I am also having the same kind of task, in my case i do have online dynamics 365 instance.

  • Suggested answer
    M.T. Eikelenboom Profile Picture
    M.T. Eikelenboom 5,241 on at
    RE: Send email and attach excel file - complex task!!

    I agree with Pawel, using a scheduled task to schedule the export seems to be the best solution. CRM doesn't have a really good option to run workflows on a specific time.

    If you can use a csv file instead of an excel, it shouldn't be to hard to build such a script. If sending mail is hard, you can always use sendgrid: https://sendgrid.com/. With a small amount of email it's free and you get a nice log and auditing of all the mails being sent.

  • Srinaath Profile Picture
    Srinaath 145 on at
    RE: Send email and attach excel file - complex task!!

    Hi Milan,

    Let's divide your task into parts

    1) Develop SSRS report using the similar query used behind view [Service Activities (filtered by day)]

    2) Develop Custom WF Activity

              a) Generate the SSRS report using the Reporting Web Services and render in excel

              b) Attach report to E-mail [Input Parameter]

              c) Send E-mail

    3) Design new Workflow

              a) Create E-mail

              b) Add Step -> Call Custom WF Activity

              c) Pass E-mail as parameter

    4) Schedule the Workflow to run every day at 18:00 PM

    Thanks

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Send email and attach excel file - complex task!!

    Hi Milan,

    I would not go for any CRM customization in this case. You should develop a console application, put it somewhere on the server and schedule it to run on Task Scheduler. The application can do whatever you want, you can use any libraries you want (for example to build excel file), you are not restricted by any CRM-specific constraints and so on. Application can of course send emails from CRM (using SendEmail message).

    BR Pawel

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans