Skip to content

KVSKBAReportManagement#

Procedures#

FillItemAttribValuesArraywithDocType(Text[100], Integer, Option, Code[10], Code[20], Enum KVSKBADocumentType) :#

Summary: Fills an array with item attribute names and values based on document type and area.

procedure FillItemAttribValuesArraywithDocType(var ItemAttribValuesArray: Text[100]; var ItemAttribValuesLineCounter: Integer; DocArea: Option; DocLanguageCodePar: Code[10]; ItemNo: Code[20]; DocType: Enum "KVSKBADocumentType"): 

Parameters:

  • ItemAttribValuesArray: Array to be filled with formatted item attribute name-value pairs.
  • ItemAttribValuesLineCounter: Counter indicating the number of filled array elements.
  • DocArea: Document area (Sales, Purchase, Service, or Rental) to determine which print settings to use.
  • DocLanguageCodePar: Language code for translating attribute names and values.
  • ItemNo: Item number for which to retrieve attributes.
  • DocType: Document type (Order, Quote, Invoice, etc.) to determine which attributes to print.

Remarks: This procedure retrieves item attributes from the Item Attribute Value Mapping table and filters them based on the print administration settings for the specific document type and area. It translates attribute names and values into the specified language, formats them as "Name: Value" pairs, and fills the array while respecting the maximum text length. Multiple attributes are combined with commas on the same line when possible. The procedure uses a temporary buffer for sorting by printing sequence number. Only attributes with print enabled for the specific document type are included. Text truncation with ellipsis (...) occurs if combined length exceeds array element size.

SetShipToAddress(Text[100]) : Text#

Summary: Converts an address array into a formatted single-line text string.

procedure SetShipToAddress(var AddressArray: Text[100]): Text

Parameters:

  • AddressArray: Array containing address components (name, street, city, etc.).

Returns: Formatted address as a single text string.

Remarks: This procedure takes an address stored as an array of text fields and converts it into a compact text representation suitable for labels or single-line displays. It copies the input array to an internal generic address array and calls FillAddressBlock to perform the actual formatting. The formatting logic in FillAddressBlock combines the array elements with appropriate separators and removes empty elements. This is commonly used for warehouse documents, shipping labels, and pick lists where space is limited.

FillAddressBlock(Text[250], Text[100]) :#

Summary: Fills a text field with a formatted address block from an address array.

procedure FillAddressBlock(var AddressField1: Text[250]; var GeneralAddressArray: Text[100]): 

Parameters:

  • AddressField1: Text field to be filled with the formatted address (max 250 characters).
  • GeneralAddressArray: Generic address array containing the address components.

Remarks: This procedure converts an address array into a formatted text block and stores it in the AddressField1 parameter. It uses the KVSKBAReportUtilities.GetAddrBlockFromArray method to combine array elements with proper separators and formatting. The result is truncated to 250 characters if necessary. This procedure is used throughout the reporting system to format addresses for printing on documents where multi-line address fields need to be condensed into a single text field. Empty array elements are automatically skipped during formatting.

Events#

OnFillItemAttribValuesArraywithDocTypeOnBeforeSetFilterScopeItemAttribValueMapping(Record Item Attribute Value Mapping, Option, Code[10], Boolean) :#

Summary: Integration event raised before filtering the Item Attribute Value Mapping for item attributes to print.

[IntegrationEvent(false, false)]
local procedure OnFillItemAttribValuesArraywithDocTypeOnBeforeSetFilterScopeItemAttribValueMapping(var ItemAttributeValueMapping: Record "Item Attribute Value Mapping"; DocArea: Option; DocLanguageCodePar: Code[10]; var Handled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAReportManagement", 'OnFillItemAttribValuesArraywithDocTypeOnBeforeSetFilterScopeItemAttribValueMapping', '', false, false)]
local procedure DoSomethingOnFillItemAttribValuesArraywithDocTypeOnBeforeSetFilterScopeItemAttribValueMapping(var ItemAttributeValueMapping: Record "Item Attribute Value Mapping"; DocArea: Option; DocLanguageCodePar: Code[10]; var Handled: Boolean)
begin
end;

Parameters:

  • ItemAttributeValueMapping: Item Attribute Value Mapping record with initial filters already applied (Table ID, No.).
  • DocArea: Document area (Sales, Purchase, Service, Rental) for which attributes are being retrieved.
  • DocLanguageCodePar: Language code for attribute translation.
  • Handled: Set to true to skip default processing and return immediately from the procedure.

Remarks: This event allows extensions to modify the filtering logic for item attributes before the print administration settings are evaluated. Subscribers can add additional filters to the ItemAttributeValueMapping record, modify the DocArea parameter, or completely bypass the default attribute retrieval by setting Handled to true. This is useful for implementing custom attribute selection rules, excluding certain attributes based on custom criteria, or integrating with third-party systems that manage attribute visibility. The event is raised in the FillItemAttribValuesArraywithDocType procedure after the initial Table ID and Item No. filters are set.

OnFillItemAttribValuesArraywithDocTypeOnAfterSetPrintAttribut(Record Item Attribute Value Mapping, Option, Code[10], Boolean) :#

Summary: Integration event raised after determining whether an item attribute should be printed based on print administration settings.

[IntegrationEvent(false, false)]
local procedure OnFillItemAttribValuesArraywithDocTypeOnAfterSetPrintAttribut(var ItemAttributeValueMapping: Record "Item Attribute Value Mapping"; DocArea: Option; DocLanguageCodePar: Code[10]; var PrintAttribut: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAReportManagement", 'OnFillItemAttribValuesArraywithDocTypeOnAfterSetPrintAttribut', '', false, false)]
local procedure DoSomethingOnFillItemAttribValuesArraywithDocTypeOnAfterSetPrintAttribut(var ItemAttributeValueMapping: Record "Item Attribute Value Mapping"; DocArea: Option; DocLanguageCodePar: Code[10]; var PrintAttribut: Boolean)
begin
end;

Parameters:

  • ItemAttributeValueMapping: Current Item Attribute Value Mapping record being evaluated.
  • DocArea: Document area (Sales, Purchase, Service, Rental) for context.
  • DocLanguageCodePar: Language code for attribute translation.
  • PrintAttribut: Boolean indicating whether the attribute should be printed; can be modified by subscribers.

Remarks: This event allows extensions to override or extend the default print attribute decision after the standard evaluation based on Print Administration settings and document type. Subscribers can change the PrintAttribut value to force inclusion or exclusion of specific attributes regardless of print settings, implement additional business rules for attribute visibility, or log attribute selection decisions. This is useful for implementing custom print rules, conditional attribute visibility based on customer segments, or compliance requirements. The event is raised within the attribute loop in FillItemAttribValuesArraywithDocType for each mapped attribute.

OnBeforeEncodeFont1DBarcodeFromNo(Text, Interface Barcode Font Provider, Enum Barcode Symbology) :#

[IntegrationEvent(false, false)]
local procedure OnBeforeEncodeFont1DBarcodeFromNo(var BarcodeString: Text; var BarcodeFontProvider: Interface "Barcode Font Provider"; var BarcodeSymbology: Enum "Barcode Symbology"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAReportManagement", 'OnBeforeEncodeFont1DBarcodeFromNo', '', false, false)]
local procedure DoSomethingOnBeforeEncodeFont1DBarcodeFromNo(var BarcodeString: Text; var BarcodeFontProvider: Interface "Barcode Font Provider"; var BarcodeSymbology: Enum "Barcode Symbology")
begin
end;