KVSKBAInvProfileOffsetting#
Procedures#
CalculatePlanFromReqTracing(Record Item, Date, Date, Record Inventory Profile, Record Stockkeeping Unit) :#
Summary: Calculates inventory planning from requisition tracing for a specific item and date range.
procedure CalculatePlanFromReqTracing(var Item: Record "Item"; OrderDate: Date; ToDate: Date; var TempInventoryProfile: Record "Inventory Profile"; var TempStockkeepingUnit: Record "Stockkeeping Unit"):
Parameters:
Item: Item record to calculate planning forOrderDate: Starting date for planning calculationsToDate: End date for planning calculationsTempInventoryProfile: Temporary inventory profile table to store calculated resultsTempStockkeepingUnit: Temporary stockkeeping unit table to store SKU combinations
Remarks: Generates demand and supply profiles, processes forecasts, and creates planning combinations for the specified item and timeframe
CheckForecastExist(Record Production Forecast Entry, Date, Date) : Boolean#
Summary: Checks if forecast entries exist within the specified date range for planning purposes.
procedure CheckForecastExist(var ForecastEntry: Record "Production Forecast Entry"; OrderDate: Date; ToDate: Date): Boolean
Parameters:
ForecastEntry: Production forecast entry record with applied filtersOrderDate: Order date to check forecast fromToDate: End date to check forecast until
Returns: Boolean indicating whether forecast entries with non-zero quantities exist in the date range
FindReplishmentLocation(Code[10], Record Item) : Boolean#
Summary: Finds a replenishment location for an item based on stockkeeping unit setup.
procedure FindReplishmentLocation(var ReplenishmentLocation: Code[10]; var Item: Record "Item"): Boolean
Parameters:
ReplenishmentLocation: Variable to store the found replenishment location codeItem: Item record to find replenishment location for
Returns: Boolean indicating whether a unique replenishment location was found
Remarks: Returns true only if exactly one SKU with replenishment system and reordering policy is found
ForecastInitDemand(Record Inventory Profile, Record Production Forecast Entry, Code[20], Code[10], Decimal) :#
Summary: Initializes demand inventory profile for forecast consumption calculations.
procedure ForecastInitDemand(var InventoryProfile: Record "Inventory Profile"; ProductionForecastEntry: Record "Production Forecast Entry"; ItemNo: Code[20]; LocationCode: Code[10]; TotalForecastQty: Decimal):
Parameters:
InventoryProfile: Inventory profile record to initializeProductionForecastEntry: Source production forecast entryItemNo: Item number for the demandLocationCode: Location code for the demandTotalForecastQty: Total forecast quantity to set as remaining quantity
GetReqLines(Record Inventory Profile, Record Item, Date) :#
Summary: Retrieves requisition lines for planning and converts them to inventory profiles.
procedure GetReqLines(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; ToDate: Date):
Parameters:
InventoryProfile: Inventory profile table to insert requisition line profilesItem: Item record to find requisition lines forToDate: End date filter for requisition lines
SetParm(Code[10], Date, Option) :#
Summary: Sets global parameters for forecast and planning calculations.
procedure SetParm(Forecast: Code[10]; ExclBefore: Date; WorksheetType: Option):
Parameters:
Forecast: Forecast code to use for planningExclBefore: Date to exclude forecast entries beforeWorksheetType: Type of worksheet (Requisition or Planning)
Events#
OnAfterDemandToInvProfile(Record Inventory Profile, Record Item, Record Reservation Entry, Integer) :#
Summary: Integration event that fires after transferring demand to inventory profile.
[IntegrationEvent(false, false)]
local procedure OnAfterDemandToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnAfterDemandToInvProfile', '', false, false)]
local procedure DoSomethingOnAfterDemandToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer)
begin
end;
Parameters:
InventoryProfile: Inventory profile table with demand entriesItem: Item record being processedReservEntry: Reservation entry table for item trackingNextLineNo: Current line number counter
Remarks: Use this event to add custom demand sources or modify existing demand profiles
OnAfterFindLinesWithItemToPlan(Record Sales Line, Boolean) :#
Summary: Integration event that allows customization after finding sales lines with item to plan.
[IntegrationEvent(false, false)]
local procedure OnAfterFindLinesWithItemToPlan(var SalesLine: Record "Sales Line"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnAfterFindLinesWithItemToPlan', '', false, false)]
local procedure DoSomethingOnAfterFindLinesWithItemToPlan(var SalesLine: Record "Sales Line"; var IsHandled: Boolean)
begin
end;
Parameters:
SalesLine: Sales line record that was foundIsHandled: Variable indicating whether the sales line processing has been handled by a subscriber
Remarks: Use this event to implement custom logic or skip standard processing for specific sales lines
OnAfterSupplyToInvProfile(Record Inventory Profile, Record Item, Date, Record Reservation Entry, Integer) :#
Summary: Integration event that fires after transferring supply to inventory profile.
[IntegrationEvent(false, false)]
local procedure OnAfterSupplyToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ToDate: Date; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnAfterSupplyToInvProfile', '', false, false)]
local procedure DoSomethingOnAfterSupplyToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ToDate: Date; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer)
begin
end;
Parameters:
InventoryProfile: Inventory profile table with supply entriesItem: Item record being processedToDate: End date for supply planningReservEntry: Reservation entry table for item trackingNextLineNo: Current line number counter
Remarks: Use this event to add custom supply sources or modify existing supply profiles
OnAfterTransToChildInvProfile(Record Reservation Entry, Record Inventory Profile) :#
Summary: Integration event that fires after transferring data to child inventory profile during item tracking unfolding.
[IntegrationEvent(false, false)]
local procedure OnAfterTransToChildInvProfile(var ReservEntry: Record "Reservation Entry"; var ChildInvtProfile: Record "Inventory Profile"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnAfterTransToChildInvProfile', '', false, false)]
local procedure DoSomethingOnAfterTransToChildInvProfile(var ReservEntry: Record "Reservation Entry"; var ChildInvtProfile: Record "Inventory Profile")
begin
end;
Parameters:
ReservEntry: Reservation entry with item tracking informationChildInvtProfile: Child inventory profile that was created with tracking details
Remarks: Use this event to modify or extend child inventory profiles with additional tracking information
OnBeforeBlanketOrderConsumpFind(Record Sales Line) :#
Summary: Integration event that allows customization of blanket sales line filtering before processing blanket order consumption.
[IntegrationEvent(false, false)]
local procedure OnBeforeBlanketOrderConsumpFind(var BlanketSalesLine: Record "Sales Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeBlanketOrderConsumpFind', '', false, false)]
local procedure DoSomethingOnBeforeBlanketOrderConsumpFind(var BlanketSalesLine: Record "Sales Line")
begin
end;
Parameters:
BlanketSalesLine: Blanket sales line record with applied filters
Remarks: Use this event to add additional filters to blanket sales lines before consumption calculations
OnBeforeDemandToInvProfile(Record Inventory Profile, Record Item, Boolean) :#
Summary: Integration event that allows customization before transferring demand to inventory profile.
[IntegrationEvent(false, false)]
local procedure OnBeforeDemandToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeDemandToInvProfile', '', false, false)]
local procedure DoSomethingOnBeforeDemandToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var IsHandled: Boolean)
begin
end;
Parameters:
InventoryProfile: Inventory profile table to be populated with demandItem: Item record being processedIsHandled: Variable indicating whether demand transfer has been handled by a subscriber
Remarks: Use this event to implement completely custom demand calculation logic
OnBeforeForecastConsumption(Record Inventory Profile, Record Item, Date, Date, Date, Boolean, Code[10], Date, Boolean, Integer) :#
Summary: Integration event that allows customization before processing forecast consumption.
[IntegrationEvent(false, false)]
local procedure OnBeforeForecastConsumption(var DemandInvtProfile: Record "Inventory Profile"; var Item: Record "Item"; OrderDate: Date; ToDate: Date; var UpdatedOrderDate: Date; var IsHandled: Boolean; var CurrForecast: Code[10]; var ExcludeForecastBefore: Date; var UseParm: Boolean; var LineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeForecastConsumption', '', false, false)]
local procedure DoSomethingOnBeforeForecastConsumption(var DemandInvtProfile: Record "Inventory Profile"; var Item: Record "Item"; OrderDate: Date; ToDate: Date; var UpdatedOrderDate: Date; var IsHandled: Boolean; var CurrForecast: Code[10]; var ExcludeForecastBefore: Date; var UseParm: Boolean; var LineNo: Integer)
begin
end;
Parameters:
DemandInvtProfile: Demand inventory profile tableItem: Item record being processedOrderDate: Order date for forecast processingToDate: End date for forecast processingUpdatedOrderDate: Variable for updated order date (can be modified by subscribers)IsHandled: Variable indicating whether forecast consumption has been handled by a subscriberCurrForecast: Current forecast codeExcludeForecastBefore: Date to exclude forecast entries beforeUseParm: Boolean indicating whether to use global parametersLineNo: Current line number counter
Remarks: Use this event to implement custom forecast consumption logic or modify forecast parameters
OnBeforeInsertInventoryProfile(Record Requisition Line, Boolean) :#
Summary: Integration event that allows customization before inserting inventory profile from requisition line.
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertInventoryProfile(RequisitionLine: Record "Requisition Line"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeInsertInventoryProfile', '', false, false)]
local procedure DoSomethingOnBeforeInsertInventoryProfile(RequisitionLine: Record "Requisition Line"; var IsHandled: Boolean)
begin
end;
Parameters:
RequisitionLine: Requisition line record to be processedIsHandled: Variable indicating whether inventory profile insertion has been handled by a subscriber
Remarks: Use this event to skip or customize inventory profile creation from specific requisition lines
OnBeforeSupplyToInvProfile(Record Inventory Profile, Record Item, Date, Record Reservation Entry, Integer) :#
Summary: Integration event that allows customization before transferring supply to inventory profile.
[IntegrationEvent(false, false)]
local procedure OnBeforeSupplyToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ToDate: Date; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeSupplyToInvProfile', '', false, false)]
local procedure DoSomethingOnBeforeSupplyToInvProfile(var InventoryProfile: Record "Inventory Profile"; var Item: Record "Item"; var ToDate: Date; var ReservEntry: Record "Reservation Entry"; var NextLineNo: Integer)
begin
end;
Parameters:
InventoryProfile: Inventory profile table to be populated with supplyItem: Item record being processedToDate: End date for supply planningReservEntry: Reservation entry table for item trackingNextLineNo: Current line number counter
Remarks: Use this event to implement custom supply calculation logic or modify supply parameters
OnBeforeTempSKUInsert(Record Stockkeeping Unit, Codeunit Planning-Get Parameters) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeTempSKUInsert(var TempSKU: Record "Stockkeeping Unit"; var PlanningGetParameters: Codeunit "Planning-Get Parameters"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeTempSKUInsert', '', false, false)]
local procedure DoSomethingOnBeforeTempSKUInsert(var TempSKU: Record "Stockkeeping Unit"; var PlanningGetParameters: Codeunit "Planning-Get Parameters")
begin
end;
OnBeforeTempTransferSKUInsert(Record Stockkeeping Unit, Record Transfer Line) :#
Summary: Integration event that fires before inserting temporary transfer SKU records.
[IntegrationEvent(false, false)]
local procedure OnBeforeTempTransferSKUInsert(var TempTransferSKU: Record "Stockkeeping Unit" temporary; TransferLine: Record "Transfer Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnBeforeTempTransferSKUInsert', '', false, false)]
local procedure DoSomethingOnBeforeTempTransferSKUInsert(var TempTransferSKU: Record "Stockkeeping Unit" temporary; TransferLine: Record "Transfer Line")
begin
end;
Parameters:
TempTransferSKU: Temporary transfer stockkeeping unit record to be insertedTransferLine: Source transfer line record
Remarks: Use this event to modify transfer SKU data before it is stored for planning calculations
OnFindCombinationAfterAssignTempSKU(Record Stockkeeping Unit, Record Inventory Profile) :#
Summary: Integration event that fires after assigning temporary SKU during combination finding.
[IntegrationEvent(false, false)]
local procedure OnFindCombinationAfterAssignTempSKU(var TempStockkeepingUnit: Record "Stockkeeping Unit" temporary; InventoryProfile: Record "Inventory Profile"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnFindCombinationAfterAssignTempSKU', '', false, false)]
local procedure DoSomethingOnFindCombinationAfterAssignTempSKU(var TempStockkeepingUnit: Record "Stockkeeping Unit" temporary; InventoryProfile: Record "Inventory Profile")
begin
end;
Parameters:
TempStockkeepingUnit: Temporary stockkeeping unit being processedInventoryProfile: Inventory profile record used for assignment
Remarks: Use this event to modify SKU assignment logic during demand/supply combination finding
OnFindNextSKUOnAfterAssignTempSKU(Record Stockkeeping Unit, Record Inventory Profile) :#
Summary: Integration event that fires after assigning temporary SKU when finding next SKU in sequence.
[IntegrationEvent(false, false)]
local procedure OnFindNextSKUOnAfterAssignTempSKU(var TempSKU: Record "Stockkeeping Unit" temporary; var InventoryProfile: Record "Inventory Profile"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnFindNextSKUOnAfterAssignTempSKU', '', false, false)]
local procedure DoSomethingOnFindNextSKUOnAfterAssignTempSKU(var TempSKU: Record "Stockkeeping Unit" temporary; var InventoryProfile: Record "Inventory Profile")
begin
end;
Parameters:
TempSKU: Temporary stockkeeping unit being assignedInventoryProfile: Inventory profile record used for assignment
Remarks: Use this event to customize SKU navigation logic during profile processing
OnFindReplishmentLocationOnBeforeFindSKU(Record Stockkeeping Unit) :#
Summary: Integration event that allows customization of SKU filtering before finding replenishment location.
[IntegrationEvent(false, false)]
local procedure OnFindReplishmentLocationOnBeforeFindSKU(var StockkeepingUnit: Record "Stockkeeping Unit"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnFindReplishmentLocationOnBeforeFindSKU', '', false, false)]
local procedure DoSomethingOnFindReplishmentLocationOnBeforeFindSKU(var StockkeepingUnit: Record "Stockkeeping Unit")
begin
end;
Parameters:
StockkeepingUnit: Stockkeeping unit record with applied filters
Remarks: Use this event to add additional filters when searching for replenishment locations
OnForecastConsumptionOnBeforeFindDemandInvtProfile(Record Inventory Profile, Boolean) :#
Summary: Integration event that allows customization of demand inventory profile filtering during forecast consumption.
[IntegrationEvent(false, false)]
local procedure OnForecastConsumptionOnBeforeFindDemandInvtProfile(var DemandInventoryProfile: Record "Inventory Profile"; ComponentForecast: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAInvProfileOffsetting", 'OnForecastConsumptionOnBeforeFindDemandInvtProfile', '', false, false)]
local procedure DoSomethingOnForecastConsumptionOnBeforeFindDemandInvtProfile(var DemandInventoryProfile: Record "Inventory Profile"; ComponentForecast: Boolean)
begin
end;
Parameters:
DemandInventoryProfile: Demand inventory profile record with applied filtersComponentForecast: Boolean indicating whether this is component forecast processing
Remarks: Use this event to modify demand profile filters based on forecast type (component vs. item forecast)