Skip to content

KVSKBAManufacturingLib#

Procedures#

CalcProjAvailableBalance(Code[20], Code[20], Code[20], Date) : Decimal#

Summary: Calculates the projected available balance for an item.

procedure CalcProjAvailableBalance(ItemNo: Code[20]; VariantCode: Code[20]; LocationCode: Code[20]; DueDate: Date): Decimal

Parameters:

  • ItemNo: The item number.
  • VariantCode: The variant code.
  • LocationCode: The location code.
  • DueDate: The due date for availability calculation.

Returns: The projected available balance as a decimal.

Remarks: Uses the Available to Promise codeunit to calculate the quantity available on a certain availability date.

ItemAvailability(Option, Record KVSKBAProdStructureBuffer) :#

Summary: This procedure is used to display item availability information based on the availability type parameter. It initializes three page objects, "Item Availability by Location", "Item Availability by Periods", and "Item Availability by Variant". Finally, the selected page object is opened in lookup mode, and the "Item" record is set as the record and table view for the page. The page is then displayed to the user as modal.

procedure ItemAvailability(AvailabilityType: Option; var ProdStructurBuffer: Record "KVSKBAProdStructureBuffer"): 

Parameters:

  • AvailabilityType: The availability type parameter (Date,Variant,Location,Bin)
  • ProdStructurBuffer: A reference to a "KVSKBAProdStructureBuffer" record

Remarks: Opens different availability pages based on the selected availability type.

InsertShowProdStructureBuffer(Record Prod. Order Component, Boolean) : Boolean#

Summary: Inserts and shows production structure buffer for components with shortage.

procedure InsertShowProdStructureBuffer(var ProdOrderComponent: Record "Prod. Order Component"; StatusChange: Boolean): Boolean

Parameters:

  • ProdOrderComponent: The production order component record.
  • StatusChange: Indicates if called during status change.

Returns: True if shortage list was confirmed or no shortage exists.

Remarks: This function inserts components without sufficient inventory into a buffer table and displays them in the shortage list.

FindRecords(Record KVSKBAProdStructureBuffer, Record KVSKBAProdStructureBuffer, Code[20], Code[20], Code[20], Code[20], Code[20], Date, Boolean, Decimal, Code[10]) :#

Summary: Manages the presentation of production BOM structure.

procedure FindRecords(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; var TempPageProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; ItemNo: Code[20]; ProdBOMNo: Code[20]; ProdBOMVersionCode: Code[20]; RoutingNo: Code[20]; RoutingVersionCode: Code[20]; CalculationDate: Date; CalcRouting: Boolean; Quantity: Decimal; UomCode: Code[10]): 

Parameters:

  • TempProdStructureBuffer: Temporary buffer for all levels.
  • TempPageProdStructureBuffer: Temporary buffer for page display.
  • ItemNo: The item number.
  • ProdBOMNo: The production BOM number.
  • ProdBOMVersionCode: The production BOM version code.
  • RoutingNo: The routing number.
  • RoutingVersionCode: The routing version code.
  • CalculationDate: The calculation date.
  • CalcRouting: Whether to calculate routing.
  • Quantity: The quantity.
  • UomCode: The unit of measure code.

Remarks: This function manages the presentation of the Production BOM via records in temporary table Production Structure Buffer.

InsertProdStructure(Record KVSKBAProdStructureBuffer, Code[20], Code[20], Code[20], Code[20], Code[20], Date, Boolean, Integer, Decimal, Decimal) :#

Summary: Inserts production structure records recursively.

procedure InsertProdStructure(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; ItemNo: Code[20]; ProdBOMNo: Code[20]; ProdBOMVersionCode: Code[20]; RoutingNo: Code[20]; RoutingVersionCode: Code[20]; CalculationDate: Date; CalcRouting: Boolean; CurrentLevel: Integer; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal): 

Parameters:

  • TempProdStructureBuffer: The temporary production structure buffer.
  • ItemNo: The item number.
  • ProdBOMNo: The production BOM number.
  • ProdBOMVersionCode: The production BOM version code.
  • RoutingNo: The routing number.
  • RoutingVersionCode: The routing version code.
  • CalculationDate: The calculation date.
  • CalcRouting: Whether to calculate routing.
  • CurrentLevel: The current level in the structure.
  • QtyBOMHeader: The BOM header quantity.
  • QtyPerUnitOfMeasure: The quantity per unit of measure.

Remarks: This function inserts records in the temporary table Production Structure Buffer via recursive call.

InsertProdStructureBufferBOM(Record KVSKBAProdStructureBuffer, Record Production BOM Line, Integer, Date, Decimal, Decimal, Record Item) :#

Summary: Inserts a production structure buffer line from a production BOM component.

procedure InsertProdStructureBufferBOM(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; ProductionBOMLine: Record "Production BOM Line"; CurrentLevel: Integer; CalculationDate: Date; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal; Item: Record "Item"): 

Parameters:

  • TempProdStructureBuffer: The temporary production structure buffer.
  • ProductionBOMLine: The production BOM line.
  • CurrentLevel: The current level in the structure.
  • CalculationDate: The calculation date.
  • QtyBOMHeader: The BOM header quantity.
  • QtyPerUnitOfMeasure: The quantity per unit of measure.
  • Item: The item record.

Remarks: Creates a buffer line with all relevant information from the production BOM component.

InsertProdStructureBufferRtg(Record KVSKBAProdStructureBuffer, Record Routing Line, Integer) :#

Summary: Inserts a production structure buffer line from a routing line.

procedure InsertProdStructureBufferRtg(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; RoutingLine: Record "Routing Line"; CurrentLevel: Integer): 

Parameters:

  • TempProdStructureBuffer: The temporary production structure buffer.
  • RoutingLine: The routing line.
  • CurrentLevel: The current level in the structure.

Remarks: Creates a buffer line with all relevant information from the routing line.

ExpandAll(Record KVSKBAProdStructureBuffer, Record KVSKBAProdStructureBuffer) :#

Summary: This function expands all levels of the structure, i.e. inserts all lines regardless the level.

procedure ExpandAll(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; var TempProdStructureBuffer2: Record "KVSKBAProdStructureBuffer"): 

Parameters:

  • TempProdStructureBuffer: Source temporary buffer.
  • TempProdStructureBuffer2: Target temporary buffer.

Remarks: Copies all records from source to target buffer to show complete structure.

IsExpanded(Record KVSKBAProdStructureBuffer, Record KVSKBAProdStructureBuffer) : Boolean#

Summary: This function gives back the actual expansion status of a Production Structure Buffer line, i.e. shows if a line has inferior structures (children) and if these structures are shown in the actual presentation.

procedure IsExpanded(ActualProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; var TempProdStructureBuffer2: Record "KVSKBAProdStructureBuffer"): Boolean

Parameters:

  • ActualProdStructureBuffer: The production structure buffer line to check.
  • TempProdStructureBuffer2: The temporary buffer with displayed records.

Returns: True if the line is expanded and children are visible.

Remarks: Determines whether child records are currently visible in the presentation.

ShowItemCard(Code[20]) :#

Summary: This function open the Item Card for a specific item

procedure ShowItemCard(ItemNo: Code[20]): 

Parameters:

  • ItemNo: The item number.

Remarks: Opens the Item Card page for the specified item.

CalcProdBOMVersionData(Code[20], Code[20], Code[20], Record Item Unit of Measure) :#

Summary: Calculates the item unit of measure based on production BOM header or version.

procedure CalcProdBOMVersionData(ItemNo: Code[20]; ProductionBOMNo: Code[20]; VersionCode: Code[20]; var ItemUnitofMeasure: Record "Item Unit of Measure"): 

Parameters:

  • ItemNo: The item number.
  • ProductionBOMNo: The production BOM number.
  • VersionCode: The production BOM version code.
  • ItemUnitofMeasure: Output parameter for the calculated unit of measure.

Remarks: Used in FindRecords and InsertProdStructure to calculate the ItemUnitofMeasure based on the triple (ItemNo, ProductionBOMNo, VersionCode).

Events#

OnInsertProdStructureBufferBOMOnAfterInserttempProdStructureBuffer(Record KVSKBAProdStructureBuffer, Record Production BOM Line, Integer, Date, Decimal, Decimal, Record Item) :#

Summary: Event raised after inserting a production structure buffer BOM line.

[IntegrationEvent(false, false)]
local procedure OnInsertProdStructureBufferBOMOnAfterInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; BOMComponent: Record "Production BOM Line"; Level: Integer; CalculationDate: Date; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal; CompItem: Record "Item"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnInsertProdStructureBufferBOMOnAfterInserttempProdStructureBuffer', '', false, false)]
local procedure DoSomethingOnInsertProdStructureBufferBOMOnAfterInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; BOMComponent: Record "Production BOM Line"; Level: Integer; CalculationDate: Date; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal; CompItem: Record "Item")
begin
end;

Parameters:

  • TempProdStructureBuffer: The inserted production structure buffer.
  • BOMComponent: The production BOM line.
  • Level: The current level.
  • CalculationDate: The calculation date.
  • QtyBOMHeader: The BOM header quantity.
  • QtyPerUnitOfMeasure: The quantity per unit of measure.
  • CompItem: The component item.

Remarks: Allows subscribers to perform additional actions after the buffer line has been inserted.

OnInsertProdStructureBufferRtgOnAfterInserttempProdStructureBuffer(Record KVSKBAProdStructureBuffer, Record Routing Line, Integer) :#

Summary: Event raised after inserting a production structure buffer routing line.

[IntegrationEvent(false, false)]
local procedure OnInsertProdStructureBufferRtgOnAfterInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; RtgLine: Record "Routing Line"; Level: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnInsertProdStructureBufferRtgOnAfterInserttempProdStructureBuffer', '', false, false)]
local procedure DoSomethingOnInsertProdStructureBufferRtgOnAfterInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; RtgLine: Record "Routing Line"; Level: Integer)
begin
end;

Parameters:

  • TempProdStructureBuffer: The inserted production structure buffer.
  • RtgLine: The routing line.
  • Level: The current level.

Remarks: Allows subscribers to perform additional actions after the buffer line has been inserted.

OnAfterTransferAddItemFieldsToProdOrd(Record Production Order, Record Item) :#

Summary: Event raised after transferring additional item fields to production order.

[IntegrationEvent(false, false)]
local procedure OnAfterTransferAddItemFieldsToProdOrd(var ProductionOrder: Record "Production Order"; Item: Record "Item"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnAfterTransferAddItemFieldsToProdOrd', '', false, false)]
local procedure DoSomethingOnAfterTransferAddItemFieldsToProdOrd(var ProductionOrder: Record "Production Order"; Item: Record "Item")
begin
end;

Parameters:

  • ProductionOrder: The production order that was updated.
  • Item: The source item.

Remarks: Allows subscribers to transfer additional custom fields from item to production order.

OnAfterTransferAddItemFieldsToPOLine(Record Prod. Order Line, Record Item) :#

Obsolete

This Element will be removed or changed with a future Version of the App.

Summary: Event raised after transferring additional item fields to production order line.

[Obsolete('The Event is no longer used', '27.2')]
[IntegrationEvent(false, false)]
local procedure OnAfterTransferAddItemFieldsToPOLine(var ProdOrderLine: Record "Prod. Order Line"; Item: Record "Item"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnAfterTransferAddItemFieldsToPOLine', '', false, false)]
local procedure DoSomethingOnAfterTransferAddItemFieldsToPOLine(var ProdOrderLine: Record "Prod. Order Line"; Item: Record "Item")
begin
end;

Parameters:

  • ProdOrderLine: The production order line that was updated.
  • Item: The source item.

Remarks: Allows subscribers to transfer additional custom fields from item to production order line.

OnAfterTransAddItJnlFieldsToItLedgEn(Record Item Journal Line, Record Item Ledger Entry) :#

Summary: Event raised after transferring additional fields from item journal line to item ledger entry.

[IntegrationEvent(false, false)]
local procedure OnAfterTransAddItJnlFieldsToItLedgEn(ItemJournalLine: Record "Item Journal Line"; var ItemLedgerEntry: Record "Item Ledger Entry"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnAfterTransAddItJnlFieldsToItLedgEn', '', false, false)]
local procedure DoSomethingOnAfterTransAddItJnlFieldsToItLedgEn(ItemJournalLine: Record "Item Journal Line"; var ItemLedgerEntry: Record "Item Ledger Entry")
begin
end;

Parameters:

  • ItemJournalLine: The source item journal line.
  • ItemLedgerEntry: The target item ledger entry that was updated.

Remarks: Allows subscribers to transfer additional custom fields during posting.

OnBeforeCalcAvailableStock(Record Prod. Order Component, Decimal, Boolean) :#

Summary: Event raised before calculating available stock.

[IntegrationEvent(false, false)]
local procedure OnBeforeCalcAvailableStock(ProdOrderComponent: Record "Prod. Order Component"; var ReturnValue: Decimal; var Handled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnBeforeCalcAvailableStock', '', false, false)]
local procedure DoSomethingOnBeforeCalcAvailableStock(ProdOrderComponent: Record "Prod. Order Component"; var ReturnValue: Decimal; var Handled: Boolean)
begin
end;

Parameters:

  • ProdOrderComponent: The production order component.
  • ReturnValue: The calculated return value.
  • Handled: Indicates if the event has been handled.

Remarks: Allows subscribers to override the standard available stock calculation.

OnBeforeProcedureInsertProdStructure(Record KVSKBAProdStructureBuffer, Code[20], Code[20], Code[20], Code[20], Code[20], Date, Boolean, Integer, Decimal, Decimal) :#

Summary: Event raised before inserting production structure records.

[IntegrationEvent(false, false)]
local procedure OnBeforeProcedureInsertProdStructure(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; ItemNo: Code[20]; ProdBOMNo: Code[20]; ProdBOMVersionCode: Code[20]; RoutingNo: Code[20]; RoutingVersionCode: Code[20]; CalculationDate: Date; CalcRouting: Boolean; ActLevel: Integer; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnBeforeProcedureInsertProdStructure', '', false, false)]
local procedure DoSomethingOnBeforeProcedureInsertProdStructure(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; ItemNo: Code[20]; ProdBOMNo: Code[20]; ProdBOMVersionCode: Code[20]; RoutingNo: Code[20]; RoutingVersionCode: Code[20]; CalculationDate: Date; CalcRouting: Boolean; ActLevel: Integer; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal)
begin
end;

Parameters:

  • TempProdStructureBuffer: The production structure buffer.
  • ItemNo: The item number.
  • ProdBOMNo: The production BOM number.
  • ProdBOMVersionCode: The production BOM version code.
  • RoutingNo: The routing number.
  • RoutingVersionCode: The routing version code.
  • CalculationDate: The calculation date.
  • CalcRouting: Whether to calculate routing.
  • ActLevel: The current level.
  • QtyBOMHeader: The BOM header quantity.
  • QtyPerUnitOfMeasure: The quantity per unit of measure.

Remarks: Allows subscribers to perform actions before production structure insertion begins.

OnBeforeInsertShowProdStructureBuffer(Record Prod. Order Component, Boolean, Boolean, Boolean) :#

Summary: Event raised before inserting and showing production structure buffer.

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertShowProdStructureBuffer(var ProdOrderComponent: Record "Prod. Order Component"; statusChangePar: Boolean; var Handled: Boolean; var ReturnValue: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnBeforeInsertShowProdStructureBuffer', '', false, false)]
local procedure DoSomethingOnBeforeInsertShowProdStructureBuffer(var ProdOrderComponent: Record "Prod. Order Component"; statusChangePar: Boolean; var Handled: Boolean; var ReturnValue: Boolean)
begin
end;

Parameters:

  • ProdOrderComponent: The production order component.
  • statusChangePar: Indicates if called during status change.
  • Handled: Indicates if the event has been handled.
  • ReturnValue: The return value.

Remarks: Allows subscribers to override the standard shortage checking logic.

OnInsertProdStructureBufferBOMOnBeforeInserttempProdStructureBuffer(Record KVSKBAProdStructureBuffer, Record Production BOM Line, Integer, Date, Decimal, Decimal, Record Item) :#

Summary: Event raised before inserting a production structure buffer BOM line.

[IntegrationEvent(false, false)]
local procedure OnInsertProdStructureBufferBOMOnBeforeInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; BOMComponent: Record "Production BOM Line"; Level: Integer; CalculationDate: Date; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal; CompItem: Record "Item"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnInsertProdStructureBufferBOMOnBeforeInserttempProdStructureBuffer', '', false, false)]
local procedure DoSomethingOnInsertProdStructureBufferBOMOnBeforeInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; BOMComponent: Record "Production BOM Line"; Level: Integer; CalculationDate: Date; QtyBOMHeader: Decimal; QtyPerUnitOfMeasure: Decimal; CompItem: Record "Item")
begin
end;

Parameters:

  • TempProdStructureBuffer: The production structure buffer to be inserted.
  • BOMComponent: The production BOM line.
  • Level: The current level.
  • CalculationDate: The calculation date.
  • QtyBOMHeader: The BOM header quantity.
  • QtyPerUnitOfMeasure: The quantity per unit of measure.
  • CompItem: The component item.

Remarks: Allows subscribers to modify the buffer record before insertion.

OnInsertProdStructureBufferRtgOnBeforeInserttempProdStructureBuffer(Record KVSKBAProdStructureBuffer, Record Routing Line, Integer) :#

Summary: Event raised before inserting a production structure buffer routing line.

[IntegrationEvent(false, false)]
local procedure OnInsertProdStructureBufferRtgOnBeforeInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; RtgLine: Record "Routing Line"; Level: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnInsertProdStructureBufferRtgOnBeforeInserttempProdStructureBuffer', '', false, false)]
local procedure DoSomethingOnInsertProdStructureBufferRtgOnBeforeInserttempProdStructureBuffer(var TempProdStructureBuffer: Record "KVSKBAProdStructureBuffer"; RtgLine: Record "Routing Line"; Level: Integer)
begin
end;

Parameters:

  • TempProdStructureBuffer: The production structure buffer to be inserted.
  • RtgLine: The routing line.
  • Level: The current level.

Remarks: Allows subscribers to modify the buffer record before insertion.

OnSetFilterCompItematCalcProjAvailableBalance(Code[20], Code[20], Code[20], Date) :#

Summary: Event raised when setting filters on component item during projected available balance calculation.

[IntegrationEvent(false, false)]
local procedure OnSetFilterCompItematCalcProjAvailableBalance(ItemNo: Code[20]; VariantCode: Code[20]; LocationCode: Code[20]; DueDate: Date): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnSetFilterCompItematCalcProjAvailableBalance', '', false, false)]
local procedure DoSomethingOnSetFilterCompItematCalcProjAvailableBalance(ItemNo: Code[20]; VariantCode: Code[20]; LocationCode: Code[20]; DueDate: Date)
begin
end;

Parameters:

  • ItemNo: The item number.
  • VariantCode: The variant code.
  • LocationCode: The location code.
  • DueDate: The due date.

Remarks: Allows subscribers to add additional filters to the item record.

SetnewInitTempTableatFindRecords(Boolean) :#

Summary: Event to control initialization of temporary table in FindRecords.

[IntegrationEvent(false, false)]
local procedure SetnewInitTempTableatFindRecords(var SetInitTempTable: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'SetnewInitTempTableatFindRecords', '', false, false)]
local procedure DoSomethingSetnewInitTempTableatFindRecords(var SetInitTempTable: Boolean)
begin
end;

Parameters:

  • SetInitTempTable: Indicates if temporary table should be initialized.

Remarks: Allows subscribers to control the initialization behavior.

SetnotShowWindowatFindRecords(Boolean) :#

Summary: Event to control window display in FindRecords.

[IntegrationEvent(false, false)]
local procedure SetnotShowWindowatFindRecords(var NotShowWindow: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'SetnotShowWindowatFindRecords', '', false, false)]
local procedure DoSomethingSetnotShowWindowatFindRecords(var NotShowWindow: Boolean)
begin
end;

Parameters:

  • NotShowWindow: Indicates if progress window should not be shown.

Remarks: Allows subscribers to suppress the calculation progress window.

OnSetFilterProductionOrderStatusOnBeforeCaseElse(Enum Production Order Status, Enum Production Order Status, Boolean) :#

[IntegrationEvent(false, false)]
local procedure OnSetFilterProductionOrderStatusOnBeforeCaseElse(i: Enum "Production Order Status"; var o: Enum "Production Order Status"; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAManufacturingLib", 'OnSetFilterProductionOrderStatusOnBeforeCaseElse', '', false, false)]
local procedure DoSomethingOnSetFilterProductionOrderStatusOnBeforeCaseElse(i: Enum "Production Order Status"; var o: Enum "Production Order Status"; var IsHandled: Boolean)
begin
end;