Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Setting Up Recurring Workflow on ALL records of an Entity

Posted on by Microsoft Employee

Hello, 

We want to set up a recurring workflow on all records of an entity. The goal is to deactivate a contract (which is a custom entity in our organisation) when the end date is passed.

I looked into this article:

https://www.powerobjects.com/2016/07/11/setting-up-recurring-workflows-in-dynamics-crm-2016/

But I guess this only applies on 1 record, or multiple records when triggered.

We want to run this once a day on ALL active records of the entity.

I also looked into Microsoft Flow, but seems this only run on 1 record of the entity also.

Anyone an idea how to establish this?

Many thanks

*This post is locked for comments

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Setting Up Recurring Workflow on ALL records of an Entity

    If you have to run a process such as this, I agree with Guido.

    Create a simple console application that retrieves all the records and performs the actions you need them to perform. Then use Task Scheduler so that it runs daily on a particular time.

    That would be the optimal and probably the easiest solution.

    If you do not have a server, then you can use Azure functions or other Azure services to perform the logic that you need.

    Hope this helps.

  • Verified answer
    Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: Setting Up Recurring Workflow on ALL records of an Entity

    If you plan to run a check once a day, the way that I normally suggest is to create an ondemand workflow (where you put the logic you want to be executed for the records that match your criteria) and a console application that search for the records that match your criteria and launch the ondemand workflow on the selected records (so you search for your contracts with an expired date)

    Normally you put the console application on a server but you can also use Azure Functions for this task (something like this tutorial)

    The code solution and the ondemand workflow makes sure that you don't clog your CRM asynchronous service with tasks that are triggered once per day on a small amount of records.

    You can of course have an only code solution (so you don't need the ondemand workflow and your console application search and deactivate your contracts) but that depends on who administer your CRM, if the logic needs to be updated by some non technical people, if you want to disable the integration for any reason, etc etc.

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