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 CRM (Archived)

Send email and attach excel file - complex task!!

(1) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    tw0sh3ds Profile Picture
    5,600 on at

    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

  • Srinaath Profile Picture
    145 on at

    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
    JohnAnonymous Profile Picture
    5,241 on at

    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.

  • EmployeeOcta Profile Picture
    6 on at

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

  • Suggested answer
    Temmy Wahyu Raharjo Profile Picture
    2,916 on at

    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

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans