Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)
Suggested answer

Best approach to fire a plugin on a schedule

(0) ShareShare
ReportReport
Posted on by 255

Hi

I have some code (in a plugin) that I'd like to use to make regular housekeeping updates to my CRM.
I'm not sure a plugin is the best approach but the functionality needs to run at 15minute intervals.
Would it be better to use a Workflow?

*This post is locked for comments

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,087 Super User 2024 Season 1 on at
    RE: Best approach to fire a plugin on a schedule

    you can use Azure Functions

    This post will help you with the schedule: https://nishantrana.me/2017/04/29/using-azure-functions-for-writing-scheduled-jobs-for-dynamics-crm/

    and this one to do a certificate based authentication: https://community.dynamics.com/crm/b/crminthefield/archive/2019/05/29/certificate-based-authentication-with-azure-functions-key-vault

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Best approach to fire a plugin on a schedule

    Hi

    Plugin is not used for running scheduled tasks in CRM.

    You could use Workflow or Flow or combination of both to do this.

    Workflow is good in executing logic in CRM but it does not have a clean scheduling mechanism.  We can get around this but creating waiting workflows. Where as Flow as a built in schedule trigger.

    So you could consider the following solution which executes a workflow

    community.dynamics.com/.../executing-dynamics-365-workflows-from-microsoft-flow

    I you would like to stick to CRM workflows, please refer to the links below

    community.dynamics.com/.../scheduling-recurring-emails-using-a-workflow

    blogs.msdn.microsoft.com/.../scheduling-recurring-workflows-in-microsoft-dynamics-crm-2011-online-and-on-premise

    gonzaloruizcrm.blogspot.com/.../quite-often-we-have-business-process.html

    You may have to move your plugin code into a Custom Workflow Activity and call the in the workflow if the logic implemented using Workflow out of the box features.

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: Best approach to fire a plugin on a schedule

    Hi,

    You can use a custom workflow assembly/action within workflow to achieve the same.

    1. Create workflow to wait for X duration defined in the entity for the specified date i.e. Scheduled Date.

    2. Create an action to perform the logic.

    3. After every x duration, update the date to date+x duration.

    4. Run the workflow on Scheduled Date update.

    If found useful, please mark this answer as verified.

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans