Table of Contents

Content Template Function

Interface: interface "PIMX Content Template Function"
Enum: enum 70113770 "PIMX Content Function Enum"

When to use

Use this interface when you need to add a function that can be called from a description-text template placeholder. The function is selected by the placeholder-processing logic and receives the content context and configured parameters before returning HTML for the generated content.

HIDDEN

DevOps sources: #35392, #7713

Use the interface

Implement Run, Validate, and LookupParameters in a codeunit. Use integer parameter keys consistently, return HTML from Run, and validate all required parameters before processing the content context. Register the codeunit in PIMX Content Function Enum so the function can be selected by the placeholder configuration.

Extend enum PIMX Content Function Enum to register the implementation.

codeunit 50000 "Custom Content Function" implements "PIMX Content Template Function"
{
	procedure Run(Context: Codeunit "PIMX Content Context"; Parameters: Dictionary of [Integer, Text]) HTML: Text
	begin
		exit('<strong>Custom content</strong>');
	end;

	procedure Validate(Context: Codeunit "PIMX Content Context"; Parameters: Dictionary of [Integer, Text]): Boolean
	begin
		exit(true);
	end;

	procedure LookupParameters(Context: Codeunit "PIMX Content Context"; var Parameters: Dictionary of [Integer, Text]): Boolean
	begin
		Parameters.Add(1, '');
		exit(true);
	end;
}