Use enrichment rules to set field values in D365 F&SCM.

To set a field value, you can use several value types. This topic explains how to set up an enrichment rule line of type Custom.

Use a custom enrichment rule line to set a field value using a custom class.

Before you can set up a custom enrichment rule line, ensure that the custom class is developed.


Data quality administrator Data quality administrator The data quality administrator (DQSDataQualityAdministrator) can set up and maintain: Data quality policies Data quality studio parameters Data quality studio general setup Developer Developer Start Start Need new custom  action class? Need new custom  action class? Inform a developer  on the action class  to be developed Inform a developer  on the action class  to be developed Develop custom action class Develop custom action class You can use a custom action rule to set a field value using a custom class.To set up a custom action rule, first develop the custom class to be applied.The custom class must extend the DQSCustomValidationBase base class.When you extend the DQSCustomValidationBase base class:Enter a unique and recognizable description() for the class. The description is shown in the lookup of the Class name field of a custom action rule.Use these methods to indicate to which data the custom class is applicable:getTablesList(): You can define the tables to which the custom class applies. As a result, you can select the custom class for a custom action rule with one of the applicable tables defined.getExtendedDataTypesList(): You can assign extended data types to which the custom class applies, for example, 'ExternalItemId'. As a result, you can select the custom class for a custom action rule with a target field defined that uses the same extended data type.getBaseTypesList(): You can define base data types to which the custom class applies, for example, String or Date. As a result, you can select the custom class for a custom action rule with a target field defined with the same data type.Use the processRecord() method to define the x++ code that defines the return value that is used as input value for the target field of the action rule.The base structure of an extended DQSCustomValidationBase class is: Inform the data quality  administrator that the  action class is available Inform the data quality  administrator that the  action class is available Create enrichment rule Create enrichment rule Use enrichment rules to set field values in D365 F&SCM. This topic explains how to create an enrichment rule. Procedure 1. Click Data quality management. 2. On the Data quality policies tab, in the list, click the link of the desired data quality policy. 3. Click the Enrichment rules tab. Note: If you want to edit another data quality policy version than the currently shown version, first select the desired version. To do so, on the Action Pane, on the Version tab, click Versions. On the dialog, select the desired version and click OK. 4. Click Add. 5. In the Table field, enter or select a value. 6. In the Event field, select an option. 7. In the Source field field, enter or select a value. Use a different target  datasource than the  source datasource? Use a different target  datasource than the  source datasource? Set up target datasource Set up target datasource For an enrichment rule, you can set a field value in a target table that is different from the source table. As a target  table, you can only use a table that is related to the source table. Set up the tables that you want to use as target table for the enrichment rule. Note: On creation of an enrichment rule, automatically, the source table is added as target table. Procedure 1. Click Data quality management. 2. On the Data quality policies tab, in the list, click the link of the desired data quality policy. 3. Click the Enrichment rules tab. 4. In the list, find and select the desired enrichment rule. 5. Click Target datasource. 6. Click New. 7. In the Relation name field, enter or select a value. 8. In the Table name field, enter or select a value. 9. In the Query field, enter or select a value. 10. For an enrichment rule, you can use 'key-field' enrichment lines to identify records in the target datasource. The 'key-field' enrichment lines setup defines to which target datasource records the enrichment rule applies. Click Create key fields. Note: If you do not want enrichment lines marked as key fields, you can remove the 'key-field' enrichment lines. To do so, click Remove key fields. 11. Close the page. Set up enrichment line of type Custom Set up enrichment line of type Custom For an enrichment rule, use an enrichment rule line to set a field value. To set a field value, you can use several value types. Use the value type Custom to set a field value using a custom class. Before you can set up a custom enrichment rule line, ensure that the custom class is developed. You can add enrichment lines in these ways: Manually. Select the target fields from a page. Procedure 1. Click Data quality management. 2. On the Data quality policies tab, in the list, click the link of the desired data quality policy. 3. Click the Enrichment rules tab. 4. In the enrichment rules list (left pane), find and select the desired enrichment rule. 5. Sub-task: Manually create enrichment line. 6. In the Enrichment lines section, click Add. 7. In the Target data source field, enter or select a value. 8. Define the target datasource field which value must be set. In the Target field field, enter or select a value. Note: If the enrichment line is marked as 'key-field' or 'has-relation', the target field is used to define to which target datasource records the enrichment rule applies. In tis case, the target field value is not set. 9. Sub-task: Create enrichment lines by selecting fields. 10. In the Enrichment lines section, click Select fields. 11. Open the page from which you want to select fields. 12. On the Field picker dialog, click Select fields. 13. Click the '+' button for each field that you want to select. 14. On the Field picker dialog, click Done. 15. On the Field picker dialog, click Submit to save the selected fields to the validation rule. 16. In the Value type field, select 'Custom'. 17. Select the Has relation check box. 18. Define the custom class to be applied for the action rule. In the Details section, in the Class name field, enter or select a value. Note: You can only select classes that extend the DQSCustomValidationBase base class. 19. Close the page. Does the enrichment rule  apply to specific data? Does the enrichment rule  apply to specific data? Set up enrichment rule conditions

Set up enrichment rule conditions

For each enrichment rule, you can set up conditions. The enrichment rule is only applied if the conditions are met.

To define an enrichment rule condition, you use a query. The enrichment rule is applied only to the records that are found by the query.
You can use these types of queries:
  • Inquiry: Use the standard D365 F&SCM Inquiry (SysQueryForm) page to define the records to which the enrichment rule applies. The inquiry only queries the table as defined for the enrichment rule.
  • Dynamic query: Use a dynamic query to define the records to which the enrichment rule applies. Before you can set up a condition with a dynamic query, set up the dynamic query to be applied. You can use a dynamic query, for example, to query other tables than the enrichment rule table, to define table relations, and to have only one record returned.

End End Yes No Yes No Yes No

Activities

Name Responsible Description

Develop custom action class

Developer

You can use a custom action rule to set a field value using a custom class.
To set up a custom action rule, first develop the custom class to be applied.
The custom class must extend the DQSCustomValidationBase base class.
When you extend the DQSCustomValidationBase base class:
  • Enter a unique and recognizable description() for the class. The description is shown in the lookup of the Class name field of a custom action rule.
  • Use these methods to indicate to which data the custom class is applicable:
    • getTablesList(): You can define the tables to which the custom class applies. As a result, you can select the custom class for a custom action rule with one of the applicable tables defined.
    • getExtendedDataTypesList(): You can assign extended data types to which the custom class applies, for example, 'ExternalItemId'. As a result, you can select the custom class for a custom action rule with a target field defined that uses the same extended data type.
    • getBaseTypesList(): You can define base data types to which the custom class applies, for example, String or Date. As a result, you can select the custom class for a custom action rule with a target field defined with the same data type.
  • Use the processRecord() method to define the x++ code that defines the return value that is used as input value for the target field of the action rule.
The base structure of an extended DQSCustomValidationBase class is:

Create enrichment rule

Data quality administrator

Use enrichment rules to set field values in D365 F&SCM.

This topic explains how to create an enrichment rule.

Set up target datasource

Data quality administrator

For an enrichment rule, you can set a field value in a target table that is different from the source table.

As a target  table, you can only use a table that is related to the source table.

Set up the tables that you want to use as target table for the enrichment rule.

Note: On creation of an enrichment rule, automatically, the source table is added as target table.

Set up enrichment line of type Custom

Data quality administrator

For an enrichment rule, use an enrichment rule line to set a field value. To set a field value, you can use several value types. Use the value type Custom to set a field value using a custom class.

Before you can set up a custom enrichment rule line, ensure that the custom class is developed.

You can add enrichment lines in these ways:

  • Manually.
  • Select the target fields from a page.

Set up enrichment rule conditions

Data quality administrator

For each enrichment rule, you can set up conditions. The enrichment rule is only applied if the conditions are met.

To define an enrichment rule condition, you use a query. The enrichment rule is applied only to the records that are found by the query.
You can use these types of queries:
  • Inquiry: Use the standard D365 F&SCM Inquiry (SysQueryForm) page to define the records to which the enrichment rule applies. The inquiry only queries the table as defined for the enrichment rule.
  • Dynamic query: Use a dynamic query to define the records to which the enrichment rule applies. Before you can set up a condition with a dynamic query, set up the dynamic query to be applied. You can use a dynamic query, for example, to query other tables than the enrichment rule table, to define table relations, and to have only one record returned.

Provide feedback