Table of Contents

Checklist Rule

Interface: interface "PIMX Checklist Rule"
Enums: enum 70113748 "PIMX Check Type"; enum 70113807 "PIMX Relation Check Type"

When to use

Use this interface when you need to add a checklist validation type that can be selected in checklist definitions and evaluated during certification. The implementation supplies the parameter handling and validation logic for checks configured in checklist relations, and the result is used by the certification process to identify failed records.

HIDDEN

DevOps sources: #31023

Use the interface

Implement the interface in a codeunit and add the codeunit as the implementation of a value in the enum that matches the checklist context. Extend PIMX Check Type for field-level checks or PIMX Relation Check Type for relation checks. Keep parameter names stable because they are stored with the checklist rule. Use CreateParameters to provide defaults, validate user input in OnValidateValue, and return a readable explanation from ShowLabel.

codeunit 50000 "Custom Checklist Rule" implements "PIMX Checklist Rule"
{
	procedure CreateParameters(ChecklistGroup: Record "PIMX Checklist Relation"; var Parameters: Dictionary of [Text, Text])
	begin
		Parameters.Add('Value', '');
	end;

	procedure OnLookupValue(Parameter: Record "PIMX Checklist Parameter"; var Value: Text)
	begin
		// Open a lookup and assign the selected value when needed.
	end;

	procedure OnValidateValue(Parameter: Record "PIMX Checklist Parameter"; Value: Text): Boolean
	begin
		exit(Value <> '');
	end;

	procedure ChecklistDataIsValid(Line: Record "PIMX Checklist Relation"; Data: Codeunit "PIMX Checklist Data"; Parameters: Dictionary of [Text, Text]): Boolean
	begin
		// Read the related data and return true when the custom check passes.
		exit(true);
	end;

	procedure ShowLabel(ChecklistRule: Record "PIMX Checklist Relation"; Parameters: Dictionary of [Text, Text]): Text
	begin
		exit('Custom checklist rule');
	end;
}