Use action rules to set field values in D365 FO.
To set a field value, you can use several action types. This topic explains how to set up an action rule of type Custom.

Use a custom action rule to set a field value using a custom class.
Before you can set up a custom action rule, ensure that the custom class is developed.
 


Data quality administrator Data quality administrator 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 Set up action rule of type Custom Set up action rule of type Custom Use action rules to set field values in D365 FO. To set a field value, you can use several action types. This topic explains how to set up an action rule of type Custom. Use a custom action rule to set a field value using a custom class. Before you can set up a custom action rule, ensure that the custom class is developed. 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 Action 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 Action type field, select 'Custom'. 8. In the Source field field, enter or select a value. 9. In the Target field field, enter or select a value. 10. Sub-task: Set the action rule properties. 11. Define the custom class to be applied for the action rule. On the Properties tab, in the Class name field, enter or select a value. Note: You can only select classes that extend the DQSCustomValidationBase base class. 12. Close the page. Notes An action rule tutorial class is provided with the Data quality studio. This tutorial class serves as an example of a custom class for a custom action rule and is not supported. You can customize the tutorial class as desired. If you want to do so, you are advised to create a copy of the tutorial class, and make the changes in the copy. Tutorial class Description DQTCustomAction_GenerateBarcode This tutorial class gets a number from a number sequence and adds a check digit to it. The full number is then entered in the target field. Notes: The number sequence, as used in this class, is hard coded (DQSBarCode). Make sure, this number sequence exists in your environment and has the desired setup. If desired, you can customize the class to use another number sequence. The check digit is defined by the tutorial class, based on the number of digits in the bar code as retrieved from the number sequence.   End End 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:

Set up action rule of type Custom

Data quality administrator

Use action rules to set field values in D365 FO.
To set a field value, you can use several action types. This topic explains how to set up an action rule of type Custom.
Use a custom action rule to set a field value using a custom class.
Before you can set up a custom action rule, ensure that the custom class is developed.

Provide feedback