Skip to content

KVSFCYCalculateInventoryValue#

Procedures#

SetItemJnlLine(Record Item Journal Line) :#

Summary: Sets the item journal line template for the inventory value calculation process. This procedure initializes the global item journal line record that serves as the template for creating revaluation entries. The journal line contains essential information such as journal template name and batch name for the revaluation process.

procedure SetItemJnlLine(var NewItemJnlLine: Record "Item Journal Line"): 

Parameters:

  • NewItemJnlLine: The item journal line record containing the journal template and batch information that will be used as the basis for creating inventory revaluation entries during the calculation process.

InitializeRequest(Date, Code[20], Boolean, Option, Boolean, Boolean, Boolean, Option, Boolean) :#

Summary: Initializes the request parameters for the inventory value calculation process. This procedure sets all the configuration options that control how the inventory valuation is calculated and processed. It allows programmatic setup of calculation settings including calculation method, location and variant handling, and display options.

procedure InitializeRequest(NewPostingDate: Date; NewDocNo: Code[20]; NewHideDuplWarning: Boolean; NewCalculatePer: Option; NewByLocation: Boolean; NewByVariant: Boolean; NewUpdStdCost: Boolean; NewCalcBase: Option; NewShowDialog: Boolean): 

Parameters:

  • NewPostingDate: The posting date to be used for the inventory revaluation entries. This date determines the valuation period and affects cost calculations.
  • NewDocNo: The document number to be assigned to the generated revaluation journal entries. If empty, the system will use the number series from the journal batch.
  • NewHideDuplWarning: Indicates whether to suppress duplicate revaluation journal warnings. When true, the system will not prompt users about potential duplicate entries.
  • NewCalculatePer: The calculation granularity option (Item or Item Ledger Entry). Determines whether to create one entry per item or separate entries for each item ledger entry.
  • NewByLocation: Indicates whether to calculate inventory values separately by location. When true, creates separate revaluation entries for each location.
  • NewByVariant: Indicates whether to calculate inventory values separately by item variant. When true, creates separate revaluation entries for each variant.
  • NewUpdStdCost: Indicates whether to update the standard cost of items based on the calculated values. Only applicable when calculating per item.
  • NewCalcBase: The calculation base option that determines how the revalued unit cost is calculated (e.g., Last Direct Cost, Standard Cost).
  • NewShowDialog: Indicates whether to display the progress dialog during processing. When true, shows item processing progress to the user.

Events#

OnAfterInitItemJnlLine(Record Item Journal Line) :#

Summary: Triggers after initializing an item journal line for inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnAfterInitItemJnlLine(var ItemJournalLine: Record "Item Journal Line"): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnAfterInitItemJnlLine', '', false, false)]
local procedure DoSomethingOnAfterInitItemJnlLine(var ItemJournalLine: Record "Item Journal Line")
begin
end;

Parameters:

  • ItemJournalLine: Item journal line record

OnAfterInsertItemJnlLine(Record Item Journal Line) :#

Summary: Triggers after inserting an item journal line for inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnAfterInsertItemJnlLine(var ItemJournalLine: Record "Item Journal Line"): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnAfterInsertItemJnlLine', '', false, false)]
local procedure DoSomethingOnAfterInsertItemJnlLine(var ItemJournalLine: Record "Item Journal Line")
begin
end;

Parameters:

  • ItemJournalLine: Item journal line record

OnAfterOnPreDataItem(Record Item) :#

Summary: Triggers after OnPreDataItem for an item in inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnAfterOnPreDataItem(var Item: Record "Item"): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnAfterOnPreDataItem', '', false, false)]
local procedure DoSomethingOnAfterOnPreDataItem(var Item: Record "Item")
begin
end;

Parameters:

  • Item: Item record

OnBeforeOnAfterGetRecord(Record Item, Boolean) :#

Summary: Triggers before OnAfterGetRecord for an item in inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnBeforeOnAfterGetRecord(var Item: Record "Item"; var SkipItem: Boolean): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnBeforeOnAfterGetRecord', '', false, false)]
local procedure DoSomethingOnBeforeOnAfterGetRecord(var Item: Record "Item"; var SkipItem: Boolean)
begin
end;

Parameters:

  • Item: Item record
  • SkipItem: Flag indicating if item should be skipped

OnBeforePreReport() :#

Summary: Triggers before the report is processed in inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnBeforePreReport(): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnBeforePreReport', '', false, false)]
local procedure DoSomethingOnBeforePreReport()
begin
end;

OnInitItemJnlLineOnBeforeValidateFields(Record Item Journal Line) :#

Summary: Triggers before validating fields when initializing an item journal line.

[IntegrationEvent(false, false)]
local procedure OnInitItemJnlLineOnBeforeValidateFields(var ItemJournalLine: Record "Item Journal Line"): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnInitItemJnlLineOnBeforeValidateFields', '', false, false)]
local procedure DoSomethingOnInitItemJnlLineOnBeforeValidateFields(var ItemJournalLine: Record "Item Journal Line")
begin
end;

Parameters:

  • ItemJournalLine: Item journal line record

OnItemAfterGetRecordOnAfterItemLedgEntrySetFilters(Record Item Ledger Entry) :#

Summary: Triggers after setting filters on item ledger entry during inventory value calculation.

[IntegrationEvent(false, false)]
local procedure OnItemAfterGetRecordOnAfterItemLedgEntrySetFilters(var ItemLedgerEntry: Record "Item Ledger Entry"): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnItemAfterGetRecordOnAfterItemLedgEntrySetFilters', '', false, false)]
local procedure DoSomethingOnItemAfterGetRecordOnAfterItemLedgEntrySetFilters(var ItemLedgerEntry: Record "Item Ledger Entry")
begin
end;

Parameters:

  • ItemLedgerEntry: Item ledger entry record

OnInsertItemJnlLineOnCaseCalcBaseOnElse(Record Item Journal Line, Enum Item Ledger Entry Type, Code[20], Code[10], Code[10], Decimal, Decimal, Integer, Decimal, Enum Inventory Value Calc. Base, Boolean, Boolean, Date) :#

[IntegrationEvent(false, false)]
local procedure OnInsertItemJnlLineOnCaseCalcBaseOnElse(var ItemJournalLine: Record "Item Journal Line"; EntryType2: Enum "Item Ledger Entry Type"; ItemNo2: Code[20]; VariantCode2: Code[10]; LocationCode2: Code[10]; Quantity2: Decimal; Amount2: Decimal; ApplyToEntry2: Integer; AppliedAmount: Decimal; CalcBase: Enum "Inventory Value Calc. Base"; ByLocation2: Boolean; ByVariant2: Boolean; PostingDate: Date): 
[EventSubscriber(ObjectType::Report, Report::"KVSFCYCalculateInventoryValue", 'OnInsertItemJnlLineOnCaseCalcBaseOnElse', '', false, false)]
local procedure DoSomethingOnInsertItemJnlLineOnCaseCalcBaseOnElse(var ItemJournalLine: Record "Item Journal Line"; EntryType2: Enum "Item Ledger Entry Type"; ItemNo2: Code[20]; VariantCode2: Code[10]; LocationCode2: Code[10]; Quantity2: Decimal; Amount2: Decimal; ApplyToEntry2: Integer; AppliedAmount: Decimal; CalcBase: Enum "Inventory Value Calc. Base"; ByLocation2: Boolean; ByVariant2: Boolean; PostingDate: Date)
begin
end;