Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Insert table of associated contacts into a document and attach to an email?

Posted on by

I have a business requirement to send a summary report to accounts with the following characteristics:

1. Recurs on a monthly basis

2. Is an email with an attachment (.docx, .xslx, .pdf, etc...) because it is being sent to a fax machine email address that only accepts and transmits attachments

3. The attachment contains a table of the contacts that are associated with the account and meet certain criteria (filters)

4. Solution is preferably no code

Using Alexander Development's Workflow Scheduler Plug-in (https://alexanderdevelopment.net/post/2016/09/19/updated-solution-for-scheduling-recurring-dynamics-crm-workflows/), I am able to schedule workflows to be run on a recurring basis. Using Kaskela's Workflow Elements(https://kaskelasolutions.com/), I am able to get query results and have them as a formatted table. So, the part I'm stuck on is step 2. I can use a Word Template, but I have no way to insert a filtered table into that template. Any help would be appreciated!

Dynamics 365 CRM Online

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Insert table of associated contacts into a document and attach to an email?

    So I thought I had figured out a workaround. I had a process that would deactivate the contacts I didn't want to include, then insert all associated contacts into the word template, send the email, then reactivate the contacts that were previously deactivated. The only problem is that it included all contacts whether they were active or inactive.

    Can you think of any work around like this that could work?

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Insert table of associated contacts into a document and attach to an email?

    Hi Bryant,

    Yes correct. Word template will show all the associated records. I can't hink of any oher no code way to achieve this.

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Insert table of associated contacts into a document and attach to an email?

    Hey Ravi,

    I think this won’t work. I don’t want all related contacts to be added into the word document, only ones that meet certain criteria (like had an activity in the last 30 days, etc...). My understanding is that I can’t filter the contacts in a repeated table - it just shows all contacts associated with the account. Is there a way to insert this filtered table into a word template or another attachment format?

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Insert table of associated contacts into a document and attach to an email?

    Hi Bryant,

    I haven't tried this but believe that word document will suit your requirement i.e.

    1) Create a word template on Account entity with a table of related contacts.

    www.youtube.com/watch

    www.toplineresults.com/.../dynamics-365-word-template-recursive-tables

    2) Create a workflow which triggers on Account entity. In this workflow, use the action SetWorkflowTemplate to generate the word document

    community.dynamics.com/.../auto-generate-word-template-in-dynamics-crm-2016-and-attach-in-email

    www.powerobjects.com/.../auto-generate-word-template-using-custom-action

    3) Use kaskela's solution to retrieve this document and attach it to email.

    kaskelasolutions.com/activity-email-an-attachment

    4) And then finally the simple send email step.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans