Use workflows to automate repetitive and predictable processes.
To design a workflow, you set up:

  • The tasks to be automated.
  • The sequence in which these tasks are done.

Designer Designer Start Start Create start and end tasks Create start and end tasks Each workflow must start with a Start task and end with an End task.This topic explains how to create a start task and an end task. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. on the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create start task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, for the start task, use 001. 9. In the Task type field, select 'Start'. 10. Sub-task: Create end task. 11. On the Tasks tab, click New. 12. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, for the end task, use 999. 13. In the Task type field, select 'End'. Set up a task to create or update a case Set up a task to create or update a case You can set up a task that creates or updates a case. For each task to create or update a case, you define the case settings. Based on these settings, the case is created or updated. For a new case, you can also define for which record an association is added to the case.If a task of type Create/update case is run, and the case action is:'Update existing case', the properties of an existing case are updated with the values as set for the task properties. To find the case to be updated:The workflow input (from the query or staging table) is checked if it has a CaseDetails or CaseDetailsBase record. If this input record exists and it has a Case ID field that is filled in, this case is updated.If in step 1. no Case ID is found, the workflow input is checked if it has another input record with a Case ID field. If an input record has a Case ID field that is filled in, this case is updated.'Create new case', a case is created. The properties of the new case are filled with the values as set for the task properties. The required case category is retrieved from the case categories as defined for the related process flow.For more information on cases, refer to Case management. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Create/update case'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Case action. 15. In the Case action field, select an option. Note: The fields shown on the dialog depend on the selected case action. 16. In the Case process field, enter or select a value. Note: This field is only available if the selected case action is 'Crete new case'. 17. In the Description field, type a value. Note: This field is only available if the selected case action is 'Crete new case'. 18. In the Department field, enter or select a value. 19. In the Status field, select an option. 20. In the Case stage field, enter or select a value. Note: This field is only available if the selected case action is 'Update existing case'. 21. In the Employee responsible field, enter or select a value. 22. In the Note field, type a value. 23. Sub-task: Set case association properties. 24. You can define for which record an association is added to the case. Make sure the entity type, data source, and field are in line with the data source and workflow input from the query or staging table. In the Parent type field, select an option. Note: This field is only available if the selected case action is 'Crete new case'. 25. In the Data source name field, enter or select a value. Note: This field is only available if the selected case action is 'Crete new case'. 26. Click OK. 27. Close the page. 28. Close the page. Set up a task to create a document Set up a task to create a document You can set up a task to create a document based on a document type. The document type defines the contents, the format, and the target of the document.Each created document is added to the Document message queue and can be processed from there. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Create document'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Document action. 15. In the Document type field, enter or select a value. Note: Make sure the document type has a perspective which query has a data source that is also defined for the workflow trigger (query or staging table). 16. In the Data source name field, enter or select a value. 17. In the Action field, select an option. 18. Click OK. 19. Close the page. 20. Close the page. Set up a task to call a class method Set up a task to call a class method You can set up a task to call a class method.Usually, you use a custom class. You can only use static methods with no parameter or one parameter defined.If you use a method with one parameter that accepts a record and the workflow is triggered by a:Query trigger, you can pass the output record from the query as input to the method.Staging table trigger, you can pass the staging table output record as input to the method.If you use a method with no parameter or you don't pass a record for a method with a parameter, the method is called without input. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Call class method'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Class method action. 15. In the Class name field, enter or select a value. 16. In the Method name field, enter or select a value. 17. Select Yes in the Pass query record field. 18. Select Yes in the Pass staging table record field. 19. Click OK. 20. Close the page. 21. Close the page. Set up a task to update a record field Set up a task to update a record field You can set up a task to update a record field of an existing record in a D365 FO table.The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, the field is updated for the relevant workflow input records. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Create/update record'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Record field action. 15. In the Data source name field, enter or select a value. 16. In the Field name field, enter or select a value. 17. In the Date field value, enter or select a value. 18. Select Yes in the Use table update methods field. 19. Click OK. 20. Close the page. 21. Close the page. Set up a task to create or update an activity Set up a task to create or update an activity You can set up a task that creates or updates an activity. For each task to create or update an activity, you define the activity settings. Based on these settings, the activity is created or updated. You can also define for which record an association is added to the activity.The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, first a check is done if the parent type is enabled for activities. If so, the defined activity action is checked. Accordingly, an activity is created or updated.If an activity is:Updated, the properties of the existing activity are updated with the values as set for the task properties.Created, the properties of the new activity are filled with the values as set for the task properties.You can view the activities here: Common > Common > Activities. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Create/update activity'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Activity action. 15. Choose the action to be done by the task: - Always create: Always an activity is created. - Create or update: An open activity is searched for the input record, parent type, data source, and purpose. If the activity exists, it is updated. If the activity does not exist, it is created. - Create if not exist: An open activity is searched for the input record, parent type, data source, and purpose. If the activity exists, nothing is done. If the activity does not exist, it is created. In the Activity actions field, select an option. Note: To be able to search for an existing activity, the activity must have an association defined. 16. In the Category field, select an option. 17. In the Purpose field, type a value. 18. In the Responsibility field, enter or select a value. Note: You can select responsibilities as defined here: Sales and marketing > Setup > Sales management > Responsibilities. 19. In the Responsible field, enter or select a value. 20. In the Description field, type a value. 21. In the Start date field, enter or select a value. 22. In the End date field, enter or select a value. 23. In the Closed field, select an option. 24. Sub-task: Set activity association properties. 25. In the Parent type field, select an option. 26. In the Data source name field, enter or select a value. 27. In the Field name field, enter or select a value. Note: The value of the defined field is set as the Parent ID in the activity association. 28. If an association is added to an activity, also automatically the linked references of the added association are added to the activity associations. For example, if a sales line is linked to a project, also an association for the project. If not desired, you can skip this. Select Yes in the Skip project association field. Note: This property is only used on creation of an activity. 29. Click OK. 30. Close the page. 31. Close the page. Set up a task to call a trigger Set up a task to call a trigger You can set up task to run a trigger. A trigger is used to start a workflow. So, you can use a Call trigger task to start another workflow from the current workflow. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Action'. 10. In the Action type field, select 'Call trigger'. 11. In the Description field, type a value. 12. Click Save. 13. Sub-task: Set task properties. 14. Click Call trigger action. 15. You can select a query trigger for any workflow. Also, for workflows of another process flow. In the Trigger field, enter or select a value. Note: To avoid an endless loop, make sure, you don't use a trigger that starts the workflow for which you set up the task. 16. Click OK. 17. Close the page. 18. Close the page. Set up a task to make a decision Set up a task to make a decision You can set up a task to make decisions based on conditions. You can set up a hierarchy of decisions. For each decision, you define the condition and what comes next if the condition is met or not.In these fields, you define what comes next if the condition is:Met (fill in only one of these fields):Node when true: You can define a next decision to be made.True result: You can define a value to indicate that the condition is met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is met, the related next task is started.Not met (fill in only one of these fields):Node when false: You can define a next decision to be made.False result: You can define a value to indicate that the condition is not met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is not met, the related next task is started.The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, based on the workflow input records, the conditions are checked, and decisions are made accordingly. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. Sub-task: Create task. 7. In the Tasks section, click New. 8. In the Task field, type a value. Note: To put the tasks in the correct sequence, you can use a number in the task field. For example, if it is the fourth task in the workflow, enter 004. 9. In the Task type field, select 'Decision'. Note: For a decision, the Action type is not applicable. 10. In the Description field, type a value. 11. Click Save. 12. Sub-task: Set up decision input. 13. Click Decision. 14. Click New. 15. In the Node field, type a value. 16. Define the decision input type. Only select 'Record value' or 'Constant'. In the Left type field, select an option. Note: If you select 'Constant', the only required field to fill in is Left value. 17. In the Left table field, enter or select a value. Note: You can only select tables as defined by the query or staging table of the workflow triggers. 18. In the Left data source field, enter or select a value. Note: You can only select data sources as defined by the query or staging table of the workflow triggers. 19. In the Left field field, enter or select a value. 20. In the Left value field, type a value. 21. Sub-task: Set up decision condition. 22. In the Operator field, select an option. 23. Define the type for the decision condition to be met. Only select 'Record value' or 'Constant'. In the Right type field, select an option. Note: If you select 'Constant', the only required field to fill in is Right value. 24. In the Right table field, enter or select a value. Note: You can only select tables as defined by the query or staging table of the workflow triggers. 25. In the Right data source field, enter or select a value. Note: You can only select data sources as defined by the query or staging table of the workflow triggers. 26. In the Right field field, enter or select a value. 27. In the Right value field, enter or select a value. Note: If the selected Right field is a date field, you can use a predefined method to set the date. If you select an 'add' method, replace 'integer' with a number. Example: (addDays(3)) sets the date three days after the date on which the decision is made. 28. Sub-task: Set up decision outcome. 29. In the Node when true field, type a value. 30. In the True result field, type a value. 31. In the Node when false field, type a value. 32. In the False result field, type a value. 33. Close the page. 34. Close the page. 35. Close the page. Define task relations Define task relations Except for the End task, for each task in the workflow, you must define the next task.For a task of type Decision, you can define several next tasks based on the outcome of the decision.For each task in a workflow, the workflow input records are the input for the task. The workflow input records are defined by the query or the staging table of the trigger. Procedure 1. Click Action and document management design. 2. On the Process flows tab, in the list, find and select the desired record. 3. In the list, click the link in the selected row. 4. On the Workflows tab, in the list, find and select the desired record. 5. Click Workflow designer. 6. On the Tasks tab, in the list, find and select the desired record. 7. In the Relations section, click New. 8. In the To field, enter or select a value. 9. In the Outcome indicator field, enter or select a value. 10. Close the page. 11. Close the page. End End

Activities

Name Responsible Description

Create start and end tasks

Designer

Each workflow must start with a Start task and end with an End task.
This topic explains how to create a start task and an end task.

Set up a task to create or update a case

Designer

You can set up a task that creates or updates a case. For each task to create or update a case, you define the case settings. Based on these settings, the case is created or updated. For a new case, you can also define for which record an association is added to the case.

If a task of type Create/update case is run, and the case action is:
  • 'Update existing case', the properties of an existing case are updated with the values as set for the task properties. To find the case to be updated:
    1. The workflow input (from the query or staging table) is checked if it has a CaseDetails or CaseDetailsBase record. If this input record exists and it has a Case ID field that is filled in, this case is updated.
    2. If in step 1. no Case ID is found, the workflow input is checked if it has another input record with a Case ID field. If an input record has a Case ID field that is filled in, this case is updated.
  • 'Create new case', a case is created. The properties of the new case are filled with the values as set for the task properties. The required case category is retrieved from the case categories as defined for the related process flow.
For more information on cases, refer to Case management.

Set up a task to create a document

Designer

You can set up a task to create a document based on a document type. The document type defines the contents, the format, and the target of the document.
Each created document is added to the Document message queue and can be processed from there.

Set up a task to call a class method

Designer

You can set up a task to call a class method.
Usually, you use a custom class. You can only use static methods with no parameter or one parameter defined.
If you use a method with one parameter that accepts a record and the workflow is triggered by a:
  • Query trigger, you can pass the output record from the query as input to the method.
  • Staging table trigger, you can pass the staging table output record as input to the method.
If you use a method with no parameter or you don't pass a record for a method with a parameter, the method is called without input.

Set up a task to update a record field

Designer

You can set up a task to update a record field of an existing record in a D365 FO table.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, the field is updated for the relevant workflow input records.

Set up a task to create or update an activity

Designer

You can set up a task that creates or updates an activity. For each task to create or update an activity, you define the activity settings. Based on these settings, the activity is created or updated. You can also define for which record an association is added to the activity.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, first a check is done if the parent type is enabled for activities. If so, the defined activity action is checked. Accordingly, an activity is created or updated.
If an activity is:
  • Updated, the properties of the existing activity are updated with the values as set for the task properties.
  • Created, the properties of the new activity are filled with the values as set for the task properties.
You can view the activities here: Common > Common > Activities.

Set up a task to call a trigger

Designer

You can set up task to run a trigger. A trigger is used to start a workflow. So, you can use a Call trigger task to start another workflow from the current workflow.

Set up a task to make a decision

Designer

You can set up a task to make decisions based on conditions. You can set up a hierarchy of decisions. For each decision, you define the condition and what comes next if the condition is met or not.
In these fields, you define what comes next if the condition is:
  • Met (fill in only one of these fields):
    • Node when true: You can define a next decision to be made.
    • True result: You can define a value to indicate that the condition is met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is met, the related next task is started.
  • Not met (fill in only one of these fields):
    • Node when false: You can define a next decision to be made.
    • False result: You can define a value to indicate that the condition is not met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is not met, the related next task is started.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, based on the workflow input records, the conditions are checked, and decisions are made accordingly.

Define task relations

Designer

Except for the End task, for each task in the workflow, you must define the next task.
For a task of type Decision, you can define several next tasks based on the outcome of the decision.
For each task in a workflow, the workflow input records are the input for the task. The workflow input records are defined by the query or the staging table of the trigger.

Activities

Name Responsible Description

Create start and end tasks

Designer

Each workflow must start with a Start task and end with an End task.
This topic explains how to create a start task and an end task.

Set up a task to create or update a case

Designer

You can set up a task that creates or updates a case. For each task to create or update a case, you define the case settings. Based on these settings, the case is created or updated. For a new case, you can also define for which record an association is added to the case.

If a task of type Create/update case is run, and the case action is:
  • 'Update existing case', the properties of an existing case are updated with the values as set for the task properties. To find the case to be updated:
    1. The workflow input (from the query or staging table) is checked if it has a CaseDetails or CaseDetailsBase record. If this input record exists and it has a Case ID field that is filled in, this case is updated.
    2. If in step 1. no Case ID is found, the workflow input is checked if it has another input record with a Case ID field. If an input record has a Case ID field that is filled in, this case is updated.
  • 'Create new case', a case is created. The properties of the new case are filled with the values as set for the task properties. The required case category is retrieved from the case categories as defined for the related process flow.
For more information on cases, refer to Case management.

Set up a task to create a document

Designer

You can set up a task to create a document based on a document type. The document type defines the contents, the format, and the target of the document.
Each created document is added to the Document message queue and can be processed from there.

Set up a task to call a class method

Designer

You can set up a task to call a class method.
Usually, you use a custom class. You can only use static methods with no parameter or one parameter defined.
If you use a method with one parameter that accepts a record and the workflow is triggered by a:
  • Query trigger, you can pass the output record from the query as input to the method.
  • Staging table trigger, you can pass the staging table output record as input to the method.
If you use a method with no parameter or you don't pass a record for a method with a parameter, the method is called without input.

Set up a task to update a record field

Designer

You can set up a task to update a record field of an existing record in a D365 FO table.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, the field is updated for the relevant workflow input records.

Set up a task to create or update an activity

Designer

You can set up a task that creates or updates an activity. For each task to create or update an activity, you define the activity settings. Based on these settings, the activity is created or updated. You can also define for which record an association is added to the activity.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, first a check is done if the parent type is enabled for activities. If so, the defined activity action is checked. Accordingly, an activity is created or updated.
If an activity is:
  • Updated, the properties of the existing activity are updated with the values as set for the task properties.
  • Created, the properties of the new activity are filled with the values as set for the task properties.
You can view the activities here: Common > Common > Activities.

Set up a task to call a trigger

Designer

You can set up task to run a trigger. A trigger is used to start a workflow. So, you can use a Call trigger task to start another workflow from the current workflow.

Set up a task to make a decision

Designer

You can set up a task to make decisions based on conditions. You can set up a hierarchy of decisions. For each decision, you define the condition and what comes next if the condition is met or not.
In these fields, you define what comes next if the condition is:
  • Met (fill in only one of these fields):
    • Node when true: You can define a next decision to be made.
    • True result: You can define a value to indicate that the condition is met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is met, the related next task is started.
  • Not met (fill in only one of these fields):
    • Node when false: You can define a next decision to be made.
    • False result: You can define a value to indicate that the condition is not met. If you set up next tasks, you can link this value to a next task. As a result, if the condition is not met, the related next task is started.
The workflow input records, as defined by the query or staging table of the trigger, are the input for the task. When the task is run, based on the workflow input records, the conditions are checked, and decisions are made accordingly.

Define task relations

Designer

Except for the End task, for each task in the workflow, you must define the next task.
For a task of type Decision, you can define several next tasks based on the outcome of the decision.
For each task in a workflow, the workflow input records are the input for the task. The workflow input records are defined by the query or the staging table of the trigger.

Provide feedback