Use enrichment rules to set field values in D365 FO.

To set a field value, you can use several value types. This topic explains how to set up an enrichment rule line of type Web service response.
Use a web service response enrichment rule line to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule line.
Before you can set up a web service response enrichment rule line, set up the web service to be used.
Note: You can set up an enrichment rule line of type 'Web service response' only if the enrichment rule event is 'Source field modified' or 'Save record'.


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 Start Start Set up web service configuration

Set up web service configuration

You can set up data quality policy rules that use a web service.

You can use a web service:

  • Validation rule to validate if a field value matches a value in another internal or external source, using a web service.
  • Enrichment rule to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule.
  • Action rule to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule.
Before you can set up a web service rule, set up the web service configuration to be used.

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. Define web service setup for enrichment rule Define web service setup for enrichment rule Use a web service response enrichment rule line to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule line. Before you can set up a web service response enrichment rule line: Set up the web service to be used. Define the web service that applies to the enrichment rule. Also define the desired request parameters setup. The enrichment rule web service and related parameters setup is explained in this topic. Request parameters For a web service, request parameters can be set up. If so, these request parameters are shown on the Web service setup page, in the Request parameters section. Note: If a Custom request handler is defined for the web service, no Request parameters are available. You can set up and apply the request parameters in several ways: Use the default parameter values, as defined for the applicable web service. In this case, no specific web service parameter setup is required for the enrichment rule. Override a default parameter value. To do so, you can use one of these Parameter types: Field, Custom, or Fixed value. Each type requires specific setup.   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. Click Webservice setup. 5. Click Edit. 6. In the Web service field, enter or select the desired web service. 7. Click Save. 8. Sub-task: Set up a request parameter override of type Field. 9. For request parameters, on the web service, a default value can be defined. You can override this default value with the value of a field. In the Request parameters section, in the list, find and select the desired parameter. Note: If no default value is defined for a request parameter, you can also use a field value to define the request parameter value. 10. Select the Override setup check box. 11. In the Parameter type field, select 'Field'. 12. In the Field name field, enter or select a value. 13. Sub-task: Set up a request parameter override of type Custom. 14. For request parameters, on the web service, a default value can be defined. You can override this default value with a value that is defined by a custom method. In the Request parameters section, in the list, find and select the desired parameter. Note: If no default value is defined for a request parameter, you can also use a custom method to define the request parameter value. 15. Select the Override setup check box. 16. In the Parameter type field, select 'Custom'. 17. Define the custom class that is used to define the request parameter value. In the Class field, enter or select a value. Note: You can only select classes that extend the DQSWebServiceParametersBase base class. This custom class must have a return method that returns a value. 18. In the Method field, enter or select a value. 19. Sub-task: Set up a request parameter override of type Fixed value. 20. For request parameters, on the web service, a default value can be defined. You can override this default value with a fixed value. In the Request parameters section, in the list, find and select the desired parameter. Note: If no default value is defined for a request parameter, you can also use a fixed value to define the request parameter value. 21. Select the Override setup check box. 22. In the Parameter type field, select 'Fixed value'. 23. In the Value field, type a value. 24. Close the page. 25. Close the page. 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 Web service response Set up enrichment line of type Web service response 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 Web service response to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule line. Before you can set up a web service response enrichment rule line: Set up the web service to be used. Define the web service that applies to the enrichment rule. Also define the desired request parameter setup.  Set up a separate enrichment rule line for each target field that must be set using a web service response parameter. Note: You can set up a enrichment rule line of type 'Web service response' only if the enrichment rule event is 'Source field modified' or 'Save record'. 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. In the Enrichment lines section, click Add. 6. In the Target data source field, enter or select a value. 7. 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. 8. In the Value type field, select 'Web service response'. 9. Select the Has relation check box. 10. Define the web service response parameter that is used to set the value of the enrichment rule target field. In the Details section, in the Parameter name field, enter or select the desired response parameter. Note: This field is not applicable if a Custom response handler is defined for the web service. 11. 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 FO 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

Activities

Name Responsible Description

Set up web service configuration

Data quality administrator

You can set up data quality policy rules that use a web service.

You can use a web service:

  • Validation rule to validate if a field value matches a value in another internal or external source, using a web service.
  • Enrichment rule to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule.
  • Action rule to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule.
Before you can set up a web service rule, set up the web service configuration to be used.

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.

Define web service setup for enrichment rule

Data quality administrator

Use a web service response enrichment rule line to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule line.

Before you can set up a web service response enrichment rule line:

  • Set up the web service to be used.
  • Define the web service that applies to the enrichment rule. Also define the desired request parameters setup. The enrichment rule web service and related parameters setup is explained in this topic.

Request parameters

For a web service, request parameters can be set up. If so, these request parameters are shown on the Web service setup page, in the Request parameters section. Note: If a Custom request handler is defined for the web service, no Request parameters are available.

You can set up and apply the request parameters in several ways:

  • Use the default parameter values, as defined for the applicable web service. In this case, no specific web service parameter setup is required for the enrichment rule.
  • Override a default parameter value. To do so, you can use one of these Parameter types: Field, Custom, or Fixed value. Each type requires specific setup.

 

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 Web service response

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 Web service response to get a field value from another internal or external source, using a web service, and set this value in the target field of the enrichment rule line.

Before you can set up a web service response enrichment rule line:

  • Set up the web service to be used.
  • Define the web service that applies to the enrichment rule. Also define the desired request parameter setup. 

Set up a separate enrichment rule line for each target field that must be set using a web service response parameter.

Note: You can set up a enrichment rule line of type 'Web service response' only if the enrichment rule event is 'Source field modified' or 'Save record'.

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 FO 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