Skip to content

KVSKBAHierarchyLib#

Procedures#

GetHierarchyFlat(Record KVSKBAHierarchyRelationship, Code[20], Text[50], Option) :#

Summary: Gets a flattened hierarchy list for external use (e.g., pricing calculations).

procedure GetHierarchyFlat(var TempHierarchyRelationship: Record "KVSKBAHierarchyRelationship" temporary; SearchHierarchyTypeCode: Code[20]; SearchPrimaryValue: Text[50]; Direction: Option): 

Parameters:

  • TempHierarchyRelationship: Temporary table to store the flattened hierarchy
  • SearchHierarchyTypeCode: Hierarchy type code to search
  • SearchPrimaryValue: Primary key value to start the search from
  • Direction: Direction of traversal (Forward or Backward)

Remarks: Creates a flat list without the tree structure, useful for processing all related records

CompressHierarchyRel(Record KVSKBAHierarchyRelationship) :#

Summary: Removes duplicate records from a hierarchy list based on Target Key Field 1 Value.

procedure CompressHierarchyRel(var TempHierarchyRelationship: Record "KVSKBAHierarchyRelationship" temporary): 

Parameters:

  • TempHierarchyRelationship: Temporary hierarchy table to compress

Remarks: Eliminates duplicate entries where the same target value appears multiple times