Skip to content

KVSFCYWhereUsedManagement#

Procedures#

FindRecord(Text, Record Where-Used Line) : Boolean#

Summary: Finds a specific record in the temporary where-used line table based on the specified search direction. This procedure provides navigation functionality for where-used analysis results by locating records using standard table navigation methods ('+', '-', '=', etc.). The found record is returned through the reference parameter if the search is successful.

procedure FindRecord(Which: Text; var WhereUsedList2: Record "Where-Used Line"): Boolean

Parameters:

  • Which: The search direction or method to use for finding the record (e.g., '+' for first, '-' for last, '=' for current position)
  • WhereUsedList2: The where-used line record (passed by reference) that serves as both search context and result container. On successful find, this record will contain the found where-used entry data

Returns: True if a record matching the search criteria was found; False if no matching record exists in the temporary where-used results

NextRecord(Integer, Record Where-Used Line) : Integer#

Summary: Moves to the next or previous record in the temporary where-used line table by the specified number of steps. This procedure provides sequential navigation through where-used analysis results, allowing forward or backward movement through the result set. The target record is returned through the reference parameter if navigation is successful, and the actual number of steps moved is returned as the function result.

procedure NextRecord(Steps: Integer; var WhereUsedList2: Record "Where-Used Line"): Integer

Parameters:

  • Steps: The number of steps to move in the where-used results (positive for forward, negative for backward navigation)
  • WhereUsedList2: The where-used line record (passed by reference) that serves as both starting position and result container. On successful navigation, this record will contain the target where-used entry data

Returns: The actual number of steps moved in the where-used results (may be less than requested if reaching beginning/end of result set)

WhereUsedFromItem(Record Item, Date, Boolean) :#

Summary: Generates a where-used analysis for a specific item, identifying all production BOMs and higher-level items that use the specified item as a component. This procedure builds a comprehensive where-used list showing all assemblies and production structures that depend on the given item, with support for both single-level and multi-level analysis. The results are stored in a temporary where-used line table for navigation.

procedure WhereUsedFromItem(Item: Record "Item"; CalcDate: Date; NewMultiLevel: Boolean): 

Parameters:

  • Item: The item record for which the where-used analysis should be performed, serving as the base component to trace usage upward through production structures
  • CalcDate: The calculation date used to determine which production BOM versions and item versions are valid and should be considered in the where-used analysis
  • NewMultiLevel: Flag indicating whether to perform multi-level where-used analysis (true) to show complete usage hierarchy, or single-level analysis (false) to show only direct usage

WhereUsedFromProdBOM(Record Production BOM Header, Date, Boolean) :#

Summary: Generates a where-used analysis for a specific production BOM, identifying all items and higher-level assemblies that use the specified production BOM in their structure. This procedure builds a comprehensive where-used list showing all items and production structures that depend on the given BOM, including analysis of all BOM versions. The analysis considers both direct BOM usage in items and usage through item versions, with support for multi-level tracing.

procedure WhereUsedFromProdBOM(ProdBOM: Record "Production BOM Header"; CalcDate: Date; NewMultiLevel: Boolean): 

Parameters:

  • ProdBOM: The production BOM header record for which the where-used analysis should be performed, serving as the base BOM to trace usage upward through production structures
  • CalcDate: The calculation date used to determine which production BOM versions and item versions are valid and should be considered in the where-used analysis
  • NewMultiLevel: Flag indicating whether to perform multi-level where-used analysis (true) to show complete usage hierarchy, or single-level analysis (false) to show only direct BOM usage

Events#

OnBuildWhereUsedListOnLoopProdBomComponent(Record Production BOM Line) :#

Summary: Triggers during where-used list building for each production BOM component.

[IntegrationEvent(false, false)]
local procedure OnBuildWhereUsedListOnLoopProdBomComponent(var ProductionBOMLine: Record "Production BOM Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYWhereUsedManagement", 'OnBuildWhereUsedListOnLoopProdBomComponent', '', false, false)]
local procedure DoSomethingOnBuildWhereUsedListOnLoopProdBomComponent(var ProductionBOMLine: Record "Production BOM Line")
begin
end;

Parameters:

  • ProductionBOMLine: Production BOM line being processed in where-used analysis.