You can set up an SQL trigger to start a data entry workflow automatically when a record is inserted or updated in a D365 F&SCM table.

This is especially useful if you have third-party integrations that import data into D365 F&SCM. It ensures that all new or updated data, whether manually entered or imported, follow a structured and controlled validation and approval workflow.

Note:

When a record is inserted or updated in a D365 F&SCM table for which data entry workflow SQL triggering is set up, the table event (Insert or Update) is logged in the Data synchronization log. To start a data entry workflow, you must process the logged table events from the data synchronization log. This processing is done based on the Workflow template SQL trigger assignment.

Designer (Data entry workflow) Designer (Data entry workflow) The Data entry workflow designer (DewDataEntryWorkflowDesigner): Enables the Data entry workflow setup. Designs and maintains data entry workflow templates. Manages data entry workflow template versions. Deploys data entry workflow templates. Start Start Set up SQL triggers Set up SQL triggers You can automatically start a data entry workflow with a SQL trigger.You can generate the SQL triggers in your database. So, no custom coding is required in the database.Before you generate the SQL triggers in your database, define the desired SQL triggers. Procedure 1. Go to Data entry workflow > Setup > SQL Trigger. 2. Click New. 3. In the Table name field, enter or select a value. 4. In the Event type field, select an option. 5. Click Create triggers. Notes To view the created SQL triggers, click SQL triggers. All data entry workflow SQL triggers that exist in the database are shown. New or changed  dynamic query required  for data entry workflow  SQL trigger? New or changed  dynamic query required  for data entry workflow  SQL trigger? Set up dynamic queries

Set up dynamic queries

Use a dynamic query to find one or more records in the database. The found records are the input for further processing.

You can use a dynamic query on a data entry workflow template SQL trigger assignment.

To define a query range, you can use a function.

Assign data entry workflow templates to SQL triggers Assign data entry workflow templates to SQL triggers When a record is inserted or updated in a D365 F&SCM table for which data entry workflow SQL triggering is set up, the table event (Insert or Update) is logged in the Data synchronization log.To start a data entry workflow, you must process the logged table events from the data synchronization log. This processing is done based on the Workflow template SQL trigger assignment.This topic explains how to set up the Workflow template SQL trigger assignment.Note: You set up a workflow template SQL trigger assignment for a specific data entry workflow template version. Procedure 1. Go to Data entry workflow > Design > Data entry workflow templates. 2. In the list, find and select the desired data entry workflow template. Note: If you want to set up the SQL trigger assignment for another version of the data entry workflow template, first select the other version. 3. On the Action Pane, click Versions. 4. Click Workflow template SQL Trigger assignment. 5. Click New. 6. In the SQL Trigger field, enter or select a value. 7. In the Root document record field, enter or select a value. 8. Select the Use query criteria check box. 9. Sub-task: Use inquiry. 10. In the Query type field, select 'Inquiry'. 11. Click Edit query. 12. In the Criteria field, type a value. Note: You can extend the inquiry setup as desired. 13. Click OK. 14. Sub-task: Use dynamic query. 15. In the Query type field, select 'Dynamic query'. 16. In the Query field, enter or select the desired dynamic query. 17. Close the page. Notes You can also set up the Workflow template SQL trigger assignment from the SQL trigger page:Go to Data entry workflow > Setup > SQL Trigger.Select the desired SQL trigger.Click Workflow template SQL trigger assignment.When opened this way, only active data entry workflow templates are shown:If you assigned an inactive data entry workflow template to a SQL trigger on Data entry workflows templates page, this assignment is not shown.If you create a new assignment, the lookup of the Workflow version field only shows active Data entry workflow templates.Note: A data entry workflow that is activated in test mode is not shown as well. End End Yes No

Activities

Name Responsible Description

Set up SQL triggers

Designer (Data entry workflow)

You can automatically start a data entry workflow with a SQL trigger.

You can generate the SQL triggers in your database. So, no custom coding is required in the database.

Before you generate the SQL triggers in your database, define the desired SQL triggers.

Set up dynamic queries

Designer (Data entry workflow)

Use a dynamic query to find one or more records in the database. The found records are the input for further processing.

You can use a dynamic query on a data entry workflow template SQL trigger assignment.

To define a query range, you can use a function.

Assign data entry workflow templates to SQL triggers

Designer (Data entry workflow)

When a record is inserted or updated in a D365 F&SCM table for which data entry workflow SQL triggering is set up, the table event (Insert or Update) is logged in the Data synchronization log.
To start a data entry workflow, you must process the logged table events from the data synchronization log. This processing is done based on the Workflow template SQL trigger assignment.

This topic explains how to set up the Workflow template SQL trigger assignment.

Note: You set up a workflow template SQL trigger assignment for a specific data entry workflow template version.

Activities

Name Responsible Description

Set up SQL triggers

Designer (Data entry workflow)

You can automatically start a data entry workflow with a SQL trigger.

You can generate the SQL triggers in your database. So, no custom coding is required in the database.

Before you generate the SQL triggers in your database, define the desired SQL triggers.

Set up dynamic queries

Designer (Data entry workflow)

Use a dynamic query to find one or more records in the database. The found records are the input for further processing.

You can use a dynamic query on a data entry workflow template SQL trigger assignment.

To define a query range, you can use a function.

Assign data entry workflow templates to SQL triggers

Designer (Data entry workflow)

When a record is inserted or updated in a D365 F&SCM table for which data entry workflow SQL triggering is set up, the table event (Insert or Update) is logged in the Data synchronization log.
To start a data entry workflow, you must process the logged table events from the data synchronization log. This processing is done based on the Workflow template SQL trigger assignment.

This topic explains how to set up the Workflow template SQL trigger assignment.

Note: You set up a workflow template SQL trigger assignment for a specific data entry workflow template version.

See also

Provide feedback