Question

I am new with Microsoft CRM 2011, I can define a workflow for an entity,

How can I implement this scenario:

Assign a task to someone one week before the expiry date of the contract.

Thanks.

Was it helpful?

Solution

  1. Create a Custom field (e.g. new_taskreminder) on Contract Entity to store date to execute workflow.

  2. Populate the newly created field with (ContractEndDate - 1 Week). You can write a plugin to populate the field or Contracts are only created using CRM UI then you can write javascript as well.

  3. Create a new Workflow and add the wait condition as below:

    Instead of Contract End Date, select the newly created field. enter image description here

  4. Under the condition, create new record. Select task from dropdown. Set the properties as you want to assign the task to someone. enter image description here

  5. Final workflow will look like this: Activate the workflow to make affect. enter image description here

UPDATE

NOTE: If you want to run workflow on fixed 7 days before ContractEndDate. You don't need to create or populate custom field. You can write the wait condition as below: But if you want to calculate the weekdays and holidays, then good to write a plugin or custom workflow activity. enter image description here

I hope it will help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top