How to: Create Workflows
You can create workflows that connect business-process tasks performed by different users. System tasks, such as automatic posting, can be included as steps in workflows, preceded or followed by user tasks. Requesting and granting approval to create new records are typical workflow steps.
In the Workflow window, you create a workflow by listing the involved steps on the lines. Each step consists of a workflow event moderated by event conditions and a workflow response with response options. You define workflow steps by filling fields on workflow lines from fixed lists of event and response values representing scenarios that are supported by the application code.
When you create workflows, you can copy the steps from existing workflows or from workflow templates. Workflow templates represent non-editable workflows that exist in the generic version of Microsoft Dynamics NAV. The code for workflow templates that are added by Microsoft are prefixed with “MS-“, such as in “MS-PIW”. For more information, see How to: Create Workflows from Workflow Templates.
If your business scenario requires workflow events or responses that are not supported, a Microsoft partner must implement them by customizing the application code. For more information, see Walkthrough: Implementing New Workflow Events and Responses.
Note
All notifications about workflow steps are sent through a job queue. Make sure that the job queue in your installation is set up to handle workflow notifications, and that the Start Automatically From NAS check box is selected. For more information, see How to: Set Up Job Queues.
To create a workflow
In the Search box, enter Workflows, and then choose the related link.
On the Home tab, in the New group, choose New. The Workflow window opens.
In the Code field, enter a maximum of 20 characters to identify the workflow.
To create the workflow from a workflow template, in the Workflows window, on the Actions tab, in the general group, choose Create Workflow from Template. For more information, see How to: Create Workflows from Workflow Templates.
In the Description field, describe the workflow.
In the Category field, specify which category the workflow belongs to.
On the Workflow Steps FastTab, in the Event Description field, specify the event that must occur to start the workflow step.
When you choose the field, the Workflow Events window opens where you select from all the workflow events that exist.
In the Condition field, specify one or more conditions that must be met before the event in the Event Description field can occur.
When you choose the field, the Event Conditions window opens where you choose from a list of filter fields that are relevant as conditions for the event in question. You can add new filter fields that you want to use as event conditions. You set event condition filters just as you set filters on report request pages. For more information, see How to: Set Filters.
If the workflow event is the change of a specific field on a record, then the Event Conditions window opens with options to select the field and the type of change.
To specify a field change for the event, in the Event Conditions window, in the Field field, select the field that changes.
In the Operator field, select either Decreased, Increased, or Changed.
In the Response Description field, specify the response that will follow when the workflow event occurs.
When you choose the field, the Workflow Responses window opens where you select from all workflow responses that exist and set response options for the selected response.
On the Options for the Selected Response FastTab, specify options for the workflow response, by selecting values in the different fields that appear, as follows:
To specify options for a workflow response that involves sending a notification, fill the fields as described in the following table.
Option Description Recipient User ID
Specify the user who the notification must be sent to.
NoteThis option is only available for workflow responses with a placeholder for a specific user. For workflow responses without placeholders for users, the notification recipient is typically defined by the approval user setup. For more information, see Approver Type and Approver Limit Type.Link Target Page
Specify another page in Microsoft Dynamics NAV that the link in the notification opens instead of the default page.
Custom Link
Specify the URL of a link that is added to the notification in addition to the link to page in Microsoft Dynamics NAV.
To specify options for a workflow response that involves creating an approval request, fill the fields as described in the following table.
Option Description Due Date Formula
Specify in how many days the approval request must be resolved from the date when it was sent.
Delegate After
Specify if and when an approval request will automatically be delegated to the relevant substitute. You can select to automatically delegate one, two, or five days after the date when the approval was requested.
Approver Type
Specify who the approver is, according to the setup of approval users and workflow users.
The following options exist:
- Salesperson/Purchaser specifies that the user who is set up in the Salespers./Purch. Code field in the Approval User Setup window determines the approver. Approval request entries are then created according to the value in the Approver Limit Type field.
For more information, see How to: Set Up Approval Users.
- Approver specifies that the user in the User ID field in the Approval User Setup window, the approval requester, determines the approver. Approval request entries are then created according to the value in the Approver Limit Type field.
- Workflow User Group specifies that the approver is the next user in the number in the Sequence No. field in the Workflow User Group window.
For more information, see How to: Set Up Workflow Users.
Show Confirmation Message
Specify if a confirmation message is shown to users after they request an approval.
Approver Limit Type
Specify how approvers’ approval limits affect when approval request entries are created for them. A qualified approver is an approver whose approval limit is above the value on the request being made.
The following options exist:
- Approver Chain specifies that approval request entries are created for all the requester’s approvers up to and including the first qualified approver.
- Direct Approver specifies that an approval request entry is only created for the requester’s immediate approver, regardless of the approver’s approval limit.
- First Qualified Approver specifies that an approval request entry is only created for the requester’s first qualified approver.
For more information and an example, see Approver Limit Type.
- Salesperson/Purchaser specifies that the user who is set up in the Salespers./Purch. Code field in the Approval User Setup window determines the approver. Approval request entries are then created according to the value in the Approver Limit Type field.
To specify options for a workflow response that involves creating journal lines, fill the fields as described in the following table.
Option Description General Journal Template Name
Specify the name of the general journal template that the specified journal lines are created in.
General Journal Batch Name
Specify the name of the general journal batch that the specified journal lines are created in.
On the Workflow Steps FastTab, choose the Increase Indent and Decrease Indent buttons to indent the event name in the Event Description field to define the step’s position in the workflow.
Indicate that the step is the next in the workflow sequence by indenting the event name under the event name of the previous step.
Indicate that the step is one of more alternative steps that may start depending on its condition by placing the event name at the same indentation as the other alternative steps. Order such optional steps according to priority by placing the most important step first.
Note
You can only change the indent of a step that does not have a subsequent step.
Repeat steps 7 through 11 to add more workflow steps, either before or after the step that you have just created.
Select the Enabled check box to specify that the workflow will start as soon as the event on the first step of type Entry Point occurs. For more information, see Use Workflows.
Note
Do not enable a workflow until you are sure that the workflow is completed and that the involved workflow steps can start.
Note
To see relations between tables that are used in workflows, in the Search box, enter Workflow – Table Relations. For more information, see Workflow - Table Relations.
See Also
Tasks
How to: Create Workflows from Workflow Templates
How to: Set Up Approval Users
How to: View Archived Workflow Step Instances
How to: Delete Workflows
Walkthrough: Setting Up and Using a Purchase Approval Workflow
Walkthrough: Implementing New Workflow Events and Responses
Concepts
Setting Up Workflow Notifications
Set Up Workflows
Use Workflows
Workflow
Business Functionality