serving the solutions day and night


Tuesday, May 7, 2013

Dynamics CRM Workflow

Dynamics CRM Workflow
Typical workflow actions include sending an email message, creating a task, and updating a data field on a record.
Dynamics CRM workflow uses the Windows Workflow Foundation framework for its core infrastructure.
Dynamics CRM workflow is Asynchronous Processing Service.
Dynamics CRM workflow processes in one of three ways: Manually by the user, Automatically from a trigger event & From another workflow
Workflow Process Security - Creating and editing workflow processes & Running workflow processes (Manual or Automatic).
Settings -> Process Center -> Processes

Create a workflow process
Enter a process name, select entity, select Workflow as the category and select new bank process, Press OK

Workflow Process Templates - Save time to create new workflow, Select Activate As -> Process template, when creating the workflow. Press 'Activate'.

Create a Workflow Process Template

Administration tab - update the owner, description, and check the workflow job retention
Automatically delete completed workflow jobs (to save disk space) - whether the completion of jobs is critical to maintain for auditing purposes. If not, check it.

Notes tab - to track notes about this workflow.
Workflows can be activation and deactivation, by the workflow owner.

If user doesn't have permission to execute all of the steps in a workflow process, including any child workflow steps. It will fail.

Show Dependencies - The dependent components are those that depend on this workflow and prevent you from deleting it while they depend on the workflow.

Available to Run (Workflow Process Execution option)
As an on-demand process - Execute a workflow process manually.
As a child process - the workflow process as a child in a different workflow process.

Scope - User, Business Unit, Parent: Child Business Units & Organization
User Scope  - user-owned entities such as accounts, and contacts.
Organization Scope - organization-owned entities such as addresses or products

An automatic workflow process - CRM uses the combination of the workflow process owner’s privileges and the scope of the workflow process to determine the records affected by the workflow.

For example, DNS user has Organization level update permission, but in the Workflow process scope is 'User' level, in this case DNS owns record will be updated by this process, becuase of limited by the scope of the workflow process.

DNS user has User level update permission, but in the Workflow process scope is 'Organization' level, in this case DNS owns record will be updated by this process, becuase of limited by the scope of the workflow process.

Start When (Trigger Events or Actions)
Record is created - Creating a new record of an entity
Record status changes - Changing the status (state - statecode) of a record
Record is assigned - Changing the owner of a record
Record fields change  - Changing one or more values on a record
Record is deleted  - Deleting a record


Stages - Stages act as groups for workflow steps. Wait conditions to each stage so that CRM won’t proceed to the next stage until the workflow process satisfies the wait conditions.

Check conditions
3 different check condition branches:
Check Condition  -  the first if-then statement
Conditional Branch - the Otherwise-if-then statement (else-if-then)
Default Action  - the Otherwise statement (else)

By clicking the <condition> (click to configure) link to open the Specify Condition dialog box

Dynamic Values  - you can insert dynamic values in a check condition by placing your cursor in the appropriate field and selecting the dynamic value in the Form Assistant. For example, sends automatically email message to a employee every time logs a service request, here you can add dynamice employee's service details, phone number.

operator - Set to, Increment by, Decrement by, Multiply by, clear.
Look for options - Select Process option -> Select any one - Activity Count (the current number of actitivites associated with the primary entity), Activity Count Including Workflow, Execution Time (the amount of time elapsed on the current workflow step, execution time value resets each time a step is taken.), Timeout (if wait coniditon selected, timeout will appear).

Wait Conditions - enable you to incorporate time - or event-based dependencies to your workflow process.  Cases like - sending an email a specified amount of time before a service expires or just waiting a given amount of time before following up with a lead.

Step Actions
Create Record -  activities and custom entity records.

Update Record - update primary or related entities
Assign Record - change the owner of the record referenced in the workflow process.
Set Properties option

Send E-mail

Email Templates - Select 'Use Template' From Send e-mail

 Start Child Workflow
  1. Execute an entirely separate workflow process as an action in the original workflow process.
  2. Reference a workflow process as a child only if it has the As a child workflow option selected in the Available to Run section
  3. Child workflow runs asynchronously - The parent workflow process will execute the child workflow process and then continue to the next step without waiting for the child workflow to finish its logic.
  4. If you require a child workflow to execute synchronously, use a custom workflow activity in the child workflow.
  5. When a workflow process executes a custom workflow activity, it does not proceed to the next step in the workflow process until Microsoft Dynamics CRM completes the entire process related to the activity.
Change Status - Change the status (statecode) and status reason (statuscode) of a record.

Stop Workflow - You want to stop a workflow somewhere in the middle of its process, typically when a condition is not met.
Succeeded - Immediately stops the workflow process with a status of Succeeded.
Canceled  - Immediately stops the workflow process with a status of Canceled.

Custom workflow actions - it will appear after custom workflow activities are registered. If webinterface workflow can't handle the situation,  use VS to create custom workflow.
Loop Detection
When you use child workflow processes, accidentally call the parent workflow process, in this situation workflow process can’t ever complete because it’s stuck in a loop. To avoid these situations,  CRM includes loop detection logic to help minimize the possibility of infinite loops occurring in the system.

Depth counter - which increments each time it executes a process. By default, eight times before automatically halting the process.

CRM resets the depth counter to zero, if the workflow is still active and hasn’t been executed for a specified period of time, Time expiration boundary - For example, workflow updates a employee’s time card status (more then eight actions). CRM handles by using a concept known as the time expiration boundary.

System jobs status reasons - Canceled, Canceling, Failed, In Progress, Pausing, Succeeded, Waiting, Waiting for Resources

Monitoring Workflow Jobs - From entity record, Workflow Process Record, System Jobs (log details)

No comments: