--- title: "Assign data entry workflow templates to SQL triggers" slug: "assign-data-entry-workflow-templates-to-sql-triggers" description: "Learn how to set up Workflow template SQL trigger assignments in D365 F&SCM for effective Data Entry Workflows and manage table events efficiently." tags: ["Task", "Data Entry Wokflow", "DEW"] updated: 2026-07-08T07:54:22Z published: 2026-07-08T07:54:22Z canonical: "docs.staedean.com/assign-data-entry-workflow-templates-to-sql-triggers" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # 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] > **Note** > > You set up a workflow template SQL trigger assignment for a specific data entry workflow template version. ### Steps 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] > **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. Define the workflow document root record for which the data entry workflows must be created. In the **Root document record** field, enter or select a value. 8. You can create a data entry workflow for specific records. To define the record criteria, use a dynamic query or the **Inquiry (SysQueryForm)** page. Select the **Use query criteria** check box. 9. Sub-task: Use inquiry. 1. You can define the record criteria using the D365 F&SCM **Inquiry (SysQueryForm)** page. In the **Query type** field, select '**Inquiry**'. 2. You must edit the inquiry. At least, enter a query value. Click **Edit query**. 3. In the **Criteria** field, type a value. > [!NOTE] > **Note** > > You can extend the inquiry setup as desired. 4. Click **OK**. 10. Sub-task: Use dynamic query. 1. You can define the record criteria using a Dynamic query. In the **Query type** field, select '**Dynamic query**'. 2. In the **Query** field, enter or select the desired dynamic query. 11. Close the page. > [!NOTE] > **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. > - A data entry workflow that is activated in test mode is not shown as well. ## Related - [Process data synchronization log - Data Entry Workflow](/process-data-synchronization-log.md)