Condition Rule
Interface: interface "PIMX Condition Rule"
Enum: enum 70113815 "PIMX Condition Check Type" (Extensible = false)
When to use
Use this interface when a checklist needs a condition-specific rule that determines whether a configured condition is satisfied for the record being checked. The condition type is selected in the checklist configuration and is evaluated as part of the checklist validation process.
HIDDEN
DevOps sources: #31023
Use the interface
Implement the interface in a codeunit and register it through PIMX Condition Check Type. Use CreateParameters for default values and OnValidateValue for parameter checks. Use ChecklistConditionIsValid only for evaluating the current checklist data; return a readable description from ShowLabel so users can understand the configured condition. Because enum 70113815 "PIMX Condition Check Type" is not extensible, adding a new condition value requires a supported change to the Pimics application rather than an enum extension.
codeunit 50000 "Custom Condition Rule" implements "PIMX Condition Rule"
{
procedure CreateParameters(ChecklistCondition: Record "PIMX Checklist Condition"; var Parameters: Dictionary of [Text, Text])
begin
Parameters.Add('Value', '');
end;
procedure OnLookupValue(Parameter: Record "PIMX Condition Parameter"; var Value: Text)
begin
// Open a lookup and assign the selected value when needed.
end;
procedure OnValidateValue(Parameter: Record "PIMX Condition Parameter"; Value: Text): Boolean
begin
exit(Value <> '');
end;
procedure ChecklistConditionIsValid(Line: Record "PIMX Checklist Condition"; Data: Codeunit "PIMX Checklist Data"; Parameters: Dictionary of [Text, Text]): Boolean
begin
// Evaluate the condition against the current checklist data.
exit(true);
end;
procedure ShowLabel(ChecklistCondition: Record "PIMX Checklist Condition"; Parameters: Dictionary of [Text, Text]): Text
begin
exit('Custom checklist condition');
end;
}