Workflow processes: Create and Edit Workflow - Dynamics 365
Workflows automate business processes without a user interface. People usually use workflow processes to initiate automation that doesn’t require any user interaction.
Each workflow process is associated with a single entity. When configuring workflows, you have four major areas to consider:
- When to start them?
- Should they run as a real-time workflow or a background workflow?
- What actions should they perform?
- Under what conditions should actions be performed?
Create and Edit a Workflow in Dynamics 365:
1. Navigate to Microsoft Dynamics 365 > Settings > Solutions click on your work solution and from solution explorer Under Components, Select Processes and Click on New Icon to create new OR Open existing by clicking from the available Workflow processes.
When you create a workflow the Create Process dialog requires that you set three properties that all processes have:
Process Name: Name of the process
Category: Workflow
Entity: Target entity on which this workflow should run.
Run this workflow in the background (recommended): This setting determines whether workflow is real time or background workflow.
After you create the Workflow or if you edit an existing one, you will have the following additional properties:
Activate as: Process
Available to Run:
1. Run this Workflow in the background (recommended): This option determines whether workflow is real time or background workflow. This option is disabled but you can change it from the Actions menu by choosing either Convert to a real-time workflow or Convert to a background workflow.
2. As an on-demand process: Choose this option if you want to allow users to run this workflow from the Run Workflow command.
3. As a child process: to start from another workflow.
Scope: You can also see the Scope, when expanded, has the following options:
For user-owned entities, options are Organization, Parent:
Child Business Units, Business Unit, or User. For
Organization-owned entities the only option is Organization.
Start When: Use the options in this section to specify when a workflow should start automatically.
- Record is created
- Record status changes
- Record is assigned
- Record fields change
- Record is deleted
Execute as: This option is only available for real-time workflow.
Workflow Components and Actions:
Processes can check conditions, apply branching logic, and perform actions. They perform these actions in a series of steps. The following are the available steps in a workflow:
Stage: Stages make the workflow logic easier to read, and explain the workflow logic.
Check Condition: a check condition is made up by an if statement, and a then statement.
Conditional Branch: can only be created directly after a Check Condition. Functions as an Otherwise, If, Then statement.
Default Action: used to run a series of steps if the Check Condition and Conditional Branch fail.
Wait: waits until a condition is met, then performs desired step.
Parallel Wait Branch: a wait condition that runs parallel to the original workflow.
Create Record: creates an entity record (or a related entity record) in selected entity.
Update Record: updates selected entity record (or related entity record) field with desired value, or with a dynamic value.
Assign Record: assigns selected entity record (or a related entity record) to a user or a team.
Send E-mail: sends an e-mail via new e-mail creation or via e-mail template.
Start Child Workflow: starts a Child Workflow. Usually to perform a task outside the original selected entity.
Change Status: changes status field of selected entity record.
Stop Workflow: stops the workflow with a status of cancelled or completed.
----------------------------------------------------------------------------------
Here is an example of a workflow to accomplish below task:
When an Account record is created, the Account is assigned to a User. Once it is assigned to a User, an e-mail will automatically be sent to the User notifying that an Account has new ownership. The e-mail will contain a record URL that links directly to the Account being assigned to the User.
1. Workflow will activate as a Process.
2. Workflow Scope is set to Organization. Workflow is set to run whenever a record is created in the Account entity.
3. Assign account to a specific User.
4. Send E-mail with URL link to Account, via new e-mail creation (see image below)
Send email Set Properties:
1. Select the From field on the form. This will be user from email will be sent.
2. Click the To field, then on the right-hand form assistant panel, select Look for: Account > Owner > Add > OK. This will send the e-mail to the user assigned to the account. Optionally selected CC, Account > Created By user.
3. Click the Subject field on the form, then on the right-hand form assistant, select Look for: Account > Account Name. This will insert the account name into the subject line of the email.
4. Select the Body part of email and compose the email. To add dynamics values look for fields from for assistant panel.
5. Click Insert Hyperlink. In the Text to display field, choose Look for Account > Account Name. In the URL field, choose Look for: Account > Record URL (Dynamic). This will build a hyperlink that when clicked brings you to the assigned account. OK!
Save and activate the workflow. Publish the customization.
To test the workflow, create an account record and check status. Email will be displayed under Activities / timeline section.
Checking workflow status:
Microsoft Dynamics 365 allows us to monitor running workflows in a couple of areas in the system. From within the workflow in the Process Sessions area we can see the records impacted by the workflow.
--OR—
Under Settings in the System Jobs area we can see all workflow statuses:
No comments:
Post a Comment