Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Custom Workflows or Reports?

Posted on by

I've got a business requirement to send a recurring email (every Saturday) to all of the accounts that currently have active contacts, with the names and several other fields from the contact entities. I'm new-ish to Dynamics 365 CRM, and my C# is super basic, but from what I can tell this will need to be a custom workflow action. Or can I leverage the Reports capability?

If I do need to create a custom workflow action that loops through accounts and sends emails to those that meet the criteria, how difficult is that going to be? Any tips on figuring this out without a lot of C#/ no FetchXML experience?

*This post is locked for comments

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Custom Workflows or Reports?

    Thanks for all the help Ravi!

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Custom Workflows or Reports?

    I may not be the best person to comment on why the emails are getting blocked at exchange but I do know if you send emails with the some common email e.g. info@something.com or accounts@something.com or support@something.com then exchange treat it as spam unless it is maked as safe at the exchange level.

    Would suggest to change the from address to some user and see if it works.

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Custom Workflows or Reports?

    Okay - using the XML instead of the view solved my filtering problem. Also, I realized that while testing I had been creating multiple workflows that were triggering the same emails to be sent multiple times. Alos, I found the setting to remove the CRM code in the subject line :)

    So, my very last hurdle to get over now is - I sent an email to my gmail and it came through just fine. I sent an email to another organization's outlook and the message never arrived. When I checked in the activities, it shows as successfully sent. It's not in the junk folder in Outlook. Is there some where else it could be getting caught up?

    Also I keep having my outbound emails blocked because Exchange thinks I'm spamming people. Any thoughts there?

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Custom Workflows or Reports?

    And here's the FetchXML:

    <?xml version="1.0"?>
    <fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
    <entity name="contact">
    <attribute name="fullname"/>
    <attribute name="contactid"/>
    <attribute name="createdon"/>
    <attribute name="new_therapistnamefreetext"/>
    <attribute name="new_pended"/>
    <attribute name="new_denied"/>
    <attribute name="new_datetoreceived"/>
    <attribute name="new_datesubmitforauth"/>
    <attribute name="new_datesigneddeliveryticketreceived"/>
    <attribute name="new_dateloanerdelivered"/>
    <attribute name="new_dateauthorizationreceived"/>
    <attribute name="new_atpevalcompletedate"/>
    <attribute name="parentcustomerid"/>
    <order descending="false" attribute="fullname"/>
    <filter type="and">
    <condition attribute="statecode" value="0" operator="eq"/>
    </filter>
    <link-entity name="account" alias="ad" link-type="inner" to="parentcustomerid" from="accountid">
    <attribute name="name"/>
    <filter type="and">
    <condition attribute="accountid" operator="not-null"/>
    </filter>
    </link-entity>
    </entity>
    </fetch>
  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Custom Workflows or Reports?

    Yeah, I will for sure mark the thread closed once we figure this out -- and I appreciate the help here.

    I'm still not getting my emails to filter the tables based on the specific account. Here's my view:

    Personal_5F00_View.PNG

    Also, I'm getting three copies of each email sent out instead of one. Thoughts on that?

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Custom Workflows or Reports?

    Do remember to close the thread once mall this is working fine by marking the suggestion as helpful :)

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Custom Workflows or Reports?

    Hi,

    You need to create a view like this (where company name is the field on contact entity which a lookup field to account entity)-

    2626.view.png

    If you want, you can also use the fetchxml directly-

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
        <entity name="contact" >
            <attribute name="fullname" />
            <attribute name="parentcustomerid" />
            <attribute name="telephone1" />
            <attribute name="emailaddress1" />
            <attribute name="contactid" />
            <order attribute="fullname" descending="false" />
            <filter type="and" >
                <condition attribute="statecode" operator="eq" value="0" />
            </filter>
            <link-entity name="account" from="accountid" to="parentcustomerid" link-type="inner" alias="aa" >
                <filter type="and" >
                    <condition attribute="accountid" operator="not-null" />
                </filter>
            </link-entity>
        </entity>
    </fetch>

    Hope this helps.

  • Bryant Boyer Profile Picture
    Bryant Boyer on at
    RE: Custom Workflows or Reports?

    Ravi, you've been so so so hepful. Thank you! The last place that I am stuck is in the Kaskela solution. In the article, it is mentioned to create a personal view with a "link" to another entity via a related field. I cannot reproduce this step. In my case, I would like the table in the email to be all of the contacts related to the account the email is being sent to. So, my view would be from the contacts, but should be linked to accounts. When I click to add the query parameter and scroll down to related records, I find "Account." But when I select it, it automatically adds a condition on the row of "contains/does not contain data". In the screenshots on the Kaskela website, there is no condition on the linked row.

    If I just ignore the condition, the emails are sent with no data in the table.

    Can you help me get through this last hurdle?

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Custom Workflows or Reports?

    Just tested this on my trial and is working perfectly :)

    contactlist.png

    Few things which may differ-

    Once you install the solution, you may not see the Reccuring Workflow entity on the sitemap (menu) for this you need to edit the entity field to display it in the sitemap.

    The workflow which comes with the managed solution "Recurring workflow runner" mau not be activated so you need to activate that.

    After importing kakela solution, the while creating the workflow, you may find that the workflow activity "Query CRM for table" does not existing, this may be because in the lates version thios has been renamed to  "Query-Get Results."

    Hope this helps.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Custom Workflows or Reports?

    Check this video from 0:58 onwards: www.youtube.com/watch

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