Question Status

Verified
Nataly P. asked a question on 27 Jan 2015 3:53 AM

Hi, All.

I must to create Process for Invoice, that will start once per day, without conditions. How I can do it?

Thanks.

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 3:58 AM

Hi Nataly,

Here you go

www.powerobjects.com/.../create-recursive-or-scheduled-workflows-in-crm

Hope that helps

Thanks

Please mark my post as verified if you found it helpful

Reply
Suggested Answer
Deepesh Somani responded on 27 Jan 2015 4:00 AM

There are no Out-of-the-Box scheduling engine in CRM, so that leaves us with a few options:

1.Host a service that implements the scheduling functionality and then have this service call into the CRM web service to perform actions regularly.

2.Leverage the CRM workflow “wait” step.

If my answer helped you, Please mark it as verified answer.

Thanks and Regards,

Deepesh Somani

My blog: http://dynamicsofdynamicscrm.wordpress.com/

Microsoft Specialist: Microsoft Dynamics CRM 2013 Applications,Extending Microsoft Dynamics CRM 2013,Microsoft Dynamics CRM 2013 Deployment,Microsoft Dynamics CRM 2013 Customization and Configuration

MCTS: Dynamics CRM 2011

Reply
Deepesh Somani responded on 27 Jan 2015 4:01 AM

A note on wait condition - try to avoid them if you can. They degrade system performance.

If my answer helped you, Please mark it as verified answer.

Thanks and Regards,

Deepesh Somani

My blog: http://dynamicsofdynamicscrm.wordpress.com/

Microsoft Specialist: Microsoft Dynamics CRM 2013 Applications,Extending Microsoft Dynamics CRM 2013,Microsoft Dynamics CRM 2013 Deployment,Microsoft Dynamics CRM 2013 Customization and Configuration

MCTS: Dynamics CRM 2011

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 4:18 AM

Hi Nataly,

Here is another example

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

There are certain drawbacks also mentioned in the article, similar to what Deepesh has mentioned. Kindly do have a look into that as well.

Thanks

Reply
Nataly P. responded on 27 Jan 2015 7:51 AM

Thanks for all. I am in development process by your advices. When will be result or questions - I'll write here.

Reply
Mithilesh Kumar responded on 27 Jan 2015 7:59 AM

Thanks Nataly, do post your queries here.

Reply
Nataly P. responded on 27 Jan 2015 8:28 AM

Such question - I must find some records with conditions in this workflow... But in workflow is absent such step as query CRM.

How I can find necessary records in workflow? Or it's not correct to use workflow for this task?

Reply
Nataly P. responded on 27 Jan 2015 8:34 AM

This is my process:

Reply
Suggested Answer
Mahadeo Matre responded on 27 Jan 2015 8:46 AM

Hi Nataly,

Check this.. might be help full for you to schedule workflow daily.

mscrmemailscheduler.codeplex.com

Reply
Nataly P. responded on 27 Jan 2015 8:53 AM

Sorry, Mahadeo. But I can't import your example - I use MS CRM 2015.

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 9:28 AM

Hi Nataly,

If your requirement is to query multiple records and process them, I will suggest you to write a Custom Workflow Activity and use Retrieve Multiple to get your records.

Register this workflow to your Organization and invoke it from the Workflow from Dynamics CRM.

Hope that helps

Thanks

Reply
Nataly P. responded on 27 Jan 2015 9:48 AM

Ok, and I can run a Custom Workflow Activity once per day? How?

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 9:55 AM

You need to invoke the Custom Workflow through the workflow in CRM.

When you register a Custom Workflow with your Organization it will appear as a Step in the workflow window, as shown below

Also you may try below logic to avoid Wait Condition in the workflow. Wait Condition will keep the Workflow alive and status will be Waiting until the wait condition is not met.

http://blog.clickdimensions.com/2013/01/how-to-schedule-workflows-in-microsoft-crm-online.html

Hope that helps

Thanks

Please mark my post as verified if found it helpful

Reply
Suggested Answer
Mahadeo Matre responded on 27 Jan 2015 9:59 AM

Nataly,

You can achieve this by calling same workflow as child workflow and updating one custom entity.

Here are steps to do this..

a. Create custom entity with one date time field

b. Create workflow, which will trigger on custom entity.

a. Create custom entity..

1. Entity Name: Global Settings (new_globalsettings)

2. Add new date time attribute as Next Run (new_nextrun)

3. Add this attribute on form.

4. Save and publish Entity.

b. Create workflow.

1. Process Name: Schedule Email

Entity: Global Settings

Category : Workflow

2. After workflow created select

Available to Run: As an on demand process and As a child process.

Scope: User

Start when : don't select any option.

3. Now add steps to workflow.

i. Add Wait condition

Configure wait condition as

Process --> Timeout --> Equal --> Global settings Next run attribute

Save this step

ii. Withing wait condition add Send Email step

iii. Configure email using either inline text or template.

iv. Add new step under wait condition for updating Global setting entity

Set Next Run attribute value to After 7 days Process execution time.

You can specify time here for recurrence of email sending.. If you want email to be send every day, then update Next run attribute value to 1 day After Execution Time. If monthly then 1 month after execution time.. and so on.

v. Save workflow.

vi. Add new step in wait condition after updating entity for "Start Child workflow"

select child workflow as current workflow (Schedule Email)

vii. save workflow and activate.

4. Add new record in global setting entity.

i. Specify name and Next run value

ii. Run workflow.

when Next run value = current time then workflow will send email and update entity for next run and same workflow will be started for next run.

Reply
Suggested Answer
Natraj Yegnaraman responded on 27 Jan 2015 3:57 PM

I have used this pattern in multiple projects and found it quite useful to implement a scheduled workflow functionality.

blogs.microsoft.co.il/.../asynchronous-batch-process-pattern-part-3

Reply
Verified Answer
Mithilesh Kumar responded on 10 Feb 2015 8:48 AM

Hi Nataly,

There is one method which you can follow to schedule your workflow. No "Wait Condition" from Workflow which degrades system performance.

  1. Create an Entity, say WorkflowScheduler
  2. Create a Record of this Entity
  3. Create a Bulk Deletion job which will delete above record. Schedule it to run at the time you want to run your workflow
  4. Create a Workflow on delete of this Entity record.
  5. This workflow will contain the logic which you want to implement. Workflow can be an in-house or custom workflow activity (your choice based on requirement). This will also create a Record of WorkflowScheduler entity.

This will be a never ending task and your workflow will be scheduled to run the moment WorkflowScheduler records gets deleted by Bulk Deletion Job

Hope that helps

Thanks

Please mark my post as verified if you found it helpful

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 3:58 AM

Hi Nataly,

Here you go

www.powerobjects.com/.../create-recursive-or-scheduled-workflows-in-crm

Hope that helps

Thanks

Please mark my post as verified if you found it helpful

Reply
Suggested Answer
Deepesh Somani responded on 27 Jan 2015 4:00 AM

There are no Out-of-the-Box scheduling engine in CRM, so that leaves us with a few options:

1.Host a service that implements the scheduling functionality and then have this service call into the CRM web service to perform actions regularly.

2.Leverage the CRM workflow “wait” step.

If my answer helped you, Please mark it as verified answer.

Thanks and Regards,

Deepesh Somani

My blog: http://dynamicsofdynamicscrm.wordpress.com/

Microsoft Specialist: Microsoft Dynamics CRM 2013 Applications,Extending Microsoft Dynamics CRM 2013,Microsoft Dynamics CRM 2013 Deployment,Microsoft Dynamics CRM 2013 Customization and Configuration

MCTS: Dynamics CRM 2011

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 4:18 AM

Hi Nataly,

Here is another example

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

There are certain drawbacks also mentioned in the article, similar to what Deepesh has mentioned. Kindly do have a look into that as well.

Thanks

Reply
Suggested Answer
Mahadeo Matre responded on 27 Jan 2015 8:46 AM

Hi Nataly,

Check this.. might be help full for you to schedule workflow daily.

mscrmemailscheduler.codeplex.com

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 9:28 AM

Hi Nataly,

If your requirement is to query multiple records and process them, I will suggest you to write a Custom Workflow Activity and use Retrieve Multiple to get your records.

Register this workflow to your Organization and invoke it from the Workflow from Dynamics CRM.

Hope that helps

Thanks

Reply
Suggested Answer
Mithilesh Kumar responded on 27 Jan 2015 9:55 AM

You need to invoke the Custom Workflow through the workflow in CRM.

When you register a Custom Workflow with your Organization it will appear as a Step in the workflow window, as shown below

Also you may try below logic to avoid Wait Condition in the workflow. Wait Condition will keep the Workflow alive and status will be Waiting until the wait condition is not met.

http://blog.clickdimensions.com/2013/01/how-to-schedule-workflows-in-microsoft-crm-online.html

Hope that helps

Thanks

Please mark my post as verified if found it helpful

Reply
Suggested Answer
Mahadeo Matre responded on 27 Jan 2015 9:59 AM

Nataly,

You can achieve this by calling same workflow as child workflow and updating one custom entity.

Here are steps to do this..

a. Create custom entity with one date time field

b. Create workflow, which will trigger on custom entity.

a. Create custom entity..

1. Entity Name: Global Settings (new_globalsettings)

2. Add new date time attribute as Next Run (new_nextrun)

3. Add this attribute on form.

4. Save and publish Entity.

b. Create workflow.

1. Process Name: Schedule Email

Entity: Global Settings

Category : Workflow

2. After workflow created select

Available to Run: As an on demand process and As a child process.

Scope: User

Start when : don't select any option.

3. Now add steps to workflow.

i. Add Wait condition

Configure wait condition as

Process --> Timeout --> Equal --> Global settings Next run attribute

Save this step

ii. Withing wait condition add Send Email step

iii. Configure email using either inline text or template.

iv. Add new step under wait condition for updating Global setting entity

Set Next Run attribute value to After 7 days Process execution time.

You can specify time here for recurrence of email sending.. If you want email to be send every day, then update Next run attribute value to 1 day After Execution Time. If monthly then 1 month after execution time.. and so on.

v. Save workflow.

vi. Add new step in wait condition after updating entity for "Start Child workflow"

select child workflow as current workflow (Schedule Email)

vii. save workflow and activate.

4. Add new record in global setting entity.

i. Specify name and Next run value

ii. Run workflow.

when Next run value = current time then workflow will send email and update entity for next run and same workflow will be started for next run.

Reply
Suggested Answer
Natraj Yegnaraman responded on 27 Jan 2015 3:57 PM

I have used this pattern in multiple projects and found it quite useful to implement a scheduled workflow functionality.

blogs.microsoft.co.il/.../asynchronous-batch-process-pattern-part-3

Reply