Skip to content

KVSKBAGeneralLib#

Procedures#

CalcNoCrossRefSlash(Text[250], Text[250], Text[250], Integer) : Text[250]#

Summary: Calculates a formatted string combining number and item reference with proper length handling.

procedure CalcNoCrossRefSlash(IndentStr: Text[250]; No: Text[250]; ItemReference: Text[250]; MaxLength: Integer): Text[250]

Parameters:

  • IndentStr: Indentation string to prefix the result
  • No: Primary number (e.g., item number)
  • ItemReference: Item reference or cross reference number
  • MaxLength: Maximum allowed length of the result string

Returns: Formatted string combining the inputs, truncated with "..." if exceeding MaxLength

Example: CalcNoCrossRefSlash(' ', '12345', 'REF001', 20) returns ' 12345 / REF001'

Remarks: Used in reports to create unified layout of Number + / + Cross Reference No

GetPlainTextFromHtml(Text) : Text#

Summary: Converts HTML formatted text to plain text by removing HTML tags and converting HTML entities.

procedure GetPlainTextFromHtml(HTMLText: Text): Text

Parameters:

  • HTMLText: HTML formatted text to be converted

Returns: Plain text with HTML tags removed and entities converted to their text equivalents

Remarks: Converts common HTML elements

ApplicationVersion() : Text[248]#

Summary: Gets the current application version from system constants.

procedure ApplicationVersion(): Text[248]

Returns: Current application version including module versions

Remarks: Returns the current Application Version from CU1 additional with the Module Versions

Events#

OnAfterFilledArray(Text[250], Text[250], Text[250], Text[250]) :#

Summary: Integration event that allows customization of the string array after it has been filled in CalcNoCrossRefSlash.

[IntegrationEvent(false, false)]
local procedure OnAfterFilledArray(var StrArray: Text[250]; IndentStr: Text[250]; No: Text[250]; ItemReference: Text[250]): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAGeneralLib", 'OnAfterFilledArray', '', false, false)]
local procedure DoSomethingOnAfterFilledArray(var StrArray: Text[250]; IndentStr: Text[250]; No: Text[250]; ItemReference: Text[250])
begin
end;

Parameters:

  • StrArray: Array of strings containing the formatted components (indentation, number, separator, reference)
  • IndentStr: Original indentation string
  • No: Original number string
  • ItemReference: Original item reference string

Remarks: Use this event to modify the string components before they are concatenated into the final result