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)

Make a workflow run on a particular day of the Week.

(0) ShareShare
ReportReport
Posted on by 7,396 User Group Leader

Hi All,

I need to trigger a workflow on a specific day of the week, say, Friday. My original thought was it would run every day and check if that day was Friday using Custom Workflow Assembly, but I am looking for a cleaner approach.

Any better thoughts on this?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    You can set up your workflow to sleep for a week and run, but you need to make sure it starts on a Friday :) I'm partial to checking for the day of the week because you can restart it any time you need to.

    There's a free workflow assembly you can install so you don't need to write custom code - Workflow Elements is available on App Source (appsource.microsoft.com/.../kaskelasolutions.8e2a0463-dde5-4869-bf39-5efc945ffdbb) or if AppSource is unavailable to you, from www.kaskelasolutions.com

    The activity to call is 'Date – Get Date Components' (kaskelasolutions.com/activity-get-date-parts) and one of the output parameters is Day of Week as an option set.

    Hope this helps! I'd appreciate if you'd mark this as Answering your question.

    Thanks,

     Aiden

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    You can always create a bulk delete job..

    Create a custom entity(or use an existing entity), set up a workflow to run on delete of that entity, and, in that workflow create another record of the same entity type (so the bulk delete job will have a record to delete the next time it starts). Other that that, do whatever else you need to do in that workflow.

    Then schedule this bulk delete job to run on the following Friday and every 7 days after that.

  • Verified answer
    Somesh2207 Profile Picture
    1,563 on at

    Hi Priyesh,

    If you are not comfortable using 3rd party solutions, you can easily develop your own custom workflow assembly.

    These are the steps for Custom workflow assembly development for your requirement:

    1. Create a Custom workflow assembly with 1 text input parameter - "Day of Week" and 1 output parameter - "Is Specified Day of week ?" (Boolean/ True or False)

    2. The CodeActivity will read this input e.g. "Friday", then get the current day of week using .NET DateTime object.

    3. Then it can compare and set the Output variable - "Is Specified Day of week ?" true or false based on comparison.

    Advantage is you can configure this to compare other days as well. as required in future if your requirement changes.

    Learn how to create Custom workflow assembly - msdn.microsoft.com/.../gg334455.aspx

  • Priyesh Profile Picture
    7,396 User Group Leader on at

    Thanks Aiden and Somesh,

    very valuable inputs. I'll need to analyze with what would work best with my client and go with that approach.

  • Community Member Profile Picture
    on at

    Hi Aiden,

    I am trying to run a weekly recurring workflow with the following parameters:

    1. Check if project template equals NOS

    2. Set the "shipped" True/False field to "False" every week

    3. This workflow should be triggered every Wednesday

    I cant seem to find the "day of week" activity in Date - Get Date Components. Am I going wrong somewhere?

    Screen-Shot-2018_2D00_03_2D00_12-at-11.18.55-AM.png

    Screen-Shot-2018_2D00_03_2D00_12-at-11.18.55-AM.png

    Please help me out if possible.

    Thanks,

    Jon

  • Temmy Wahyu Raharjo Profile Picture
    2,916 on at

    If you use workflow and put sleep, I'm afraid there will be a lot of workflow with status pending. For this purpose, I actually more prefer using console application (creating IOrganizationService) and do the logic there.

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi Jon,

    the Day of week is available after the workflow return something. You cant use it within the custom workflow.

    2514.27.png

    2514.27.png

  • Community Member Profile Picture
    on at

    Hi Wei Jei,

    Thank you so much. I just wasnt able to find the "day of week" part.

    If I want to update the TRUE/FALSE "shipped" field to False, every Wednesday, how can I exactly set up the workflow parameters?

    Thanks,

    Jon

  • Community Member Profile Picture
    on at

    Currently I have this so far

    First check if project template is NOS

    Then Update Project where Shipped field is set to False 

    How would I configure the day of week condition (run every Wednesday)?

    Screen-Shot-2018_2D00_03_2D00_12-at-11.51.31-AM.png

  • Karuna Karan Profile Picture
    1,212 on at

    You can develop a custom workflow assembly something like this. It's serving great purposes for me in my organization.

    Run Frequency can be set to Daily, Weekly, Monthly, etc.

    wf-assem.png

    Regards

    KK

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