KVSKBAPriceCalcPricePrio#
Procedures#
GetLine(Variant) :#
Summary: Retrieves the current line being processed.
procedure GetLine(var Line: Variant):
Parameters:
Line: Output variant containing the line record.
Remarks: Returns the line from the current LineWithPrice interface implementation. Used to access the underlying line record during price calculations.
Init(Interface Line With Price, Record Price Calculation Setup) :#
procedure Init(NewLineWithPrice: Interface "Line With Price"; PriceCalculationSetup: Record "Price Calculation Setup"):
ApplyDiscount() :#
Summary: Applies the best discount to the current line based on priority rules.
procedure ApplyDiscount():
Remarks: Checks read permissions for discount access tables. Only processes if discount is allowed on the line. Uses priority-based selection to find the best discount. Handles KUMAVISION condition-based discounts for sales, service, and purchase lines. Updates the line with the calculated discount.
ApplyPrice(Integer) :#
Summary: Applies the best price to the current line based on priority rules.
procedure ApplyPrice(CalledByFieldNo: Integer):
Parameters:
CalledByFieldNo: The field number that triggered the price calculation.
Remarks: Checks read permissions for price access tables. Uses priority-based selection to find the best price. Handles KUMAVISION condition-based prices for sales, service, and purchase lines. Only updates the price if needed based on the calling field. Updates the line with the calculated price.
CountDiscount(Boolean) : Integer#
Summary: Counts the number of discount lines available for the current line.
procedure CountDiscount(ShowAll: Boolean): Integer
Parameters:
ShowAll: If true, shows all lines; if false, only shows applicable lines.
Returns: The number of discount lines found.
Remarks: Useful for determining if discount options are available before displaying them.
CountPrice(Boolean) : Integer#
Summary: Counts the number of price lines available for the current line.
procedure CountPrice(ShowAll: Boolean): Integer
Parameters:
ShowAll: If true, shows all lines; if false, only shows applicable lines.
Returns: The number of price lines found.
Remarks: Useful for determining if price options are available before displaying them.
FindDiscount(Record Price List Line, Boolean) : Boolean#
Summary: Finds all discount lines applicable to the current line using priority rules.
procedure FindDiscount(var TempPriceListLine: Record "Price List Line"; ShowAll: Boolean): Boolean
Parameters:
TempPriceListLine: Temporary buffer to receive the found discount lines.ShowAll: If true, shows all lines; if false, only shows applicable lines.
Returns: True if discount lines were found, false otherwise.
Remarks: Populates the temporary price list line buffer with matching discount lines. Uses hierarchy and priority logic for selection.
FindPrice(Record Price List Line, Boolean) : Boolean#
Summary: Finds all price lines applicable to the current line using priority rules.
procedure FindPrice(var TempPriceListLine: Record "Price List Line"; ShowAll: Boolean): Boolean
Parameters:
TempPriceListLine: Temporary buffer to receive the found price lines.ShowAll: If true, shows all lines; if false, only shows applicable lines.
Returns: True if price lines were found, false otherwise.
Remarks: Populates the temporary price list line buffer with matching price lines. Uses hierarchy and priority logic for selection.
IsDiscountExists(Boolean) : Boolean#
Summary: Checks if any discount lines exist for the current line.
procedure IsDiscountExists(ShowAll: Boolean): Boolean
Parameters:
ShowAll: If true, checks all lines; if false, only checks applicable lines.
Returns: True if discount lines exist, false otherwise.
Remarks: Quick check to determine discount availability without retrieving all lines.
IsPriceExists(Boolean) : Boolean#
Summary: Checks if any price lines exist for the current line.
procedure IsPriceExists(ShowAll: Boolean): Boolean
Parameters:
ShowAll: If true, checks all lines; if false, only checks applicable lines.
Returns: True if price lines exist, false otherwise.
Remarks: Quick check to determine price availability without retrieving all lines.
PickDiscount() :#
Summary: Opens a page to manually select a discount line.
procedure PickDiscount():
Remarks: Displays all applicable discount lines in a lookup page. Applies the selected discount to the current line. Handles KUMAVISION condition-based discounts. Validates the selected line before applying.
PickPrice() :#
Summary: Opens a page to manually select a price line.
procedure PickPrice():
Remarks: Displays all applicable price lines in a lookup page. Applies the selected price to the current line. Handles KUMAVISION condition-based prices. Validates the selected line before applying.
ShowPrices(Record Price List Line) :#
Summary: Opens a page displaying all available prices for the current line.
procedure ShowPrices(var TempPriceListLine: Record "Price List Line"):
Parameters:
TempPriceListLine: Temporary buffer containing the price lines to display.
Remarks: Shows all price and discount lines applicable to the current line. Opens lookup page for user review without applying automatically. Useful for price verification and analysis. Raises OnBeforeShowPrices integration event.
IsBetterLine(Record Price List Line, Enum Price Amount Type, Record Price List Line) : Boolean#
procedure IsBetterLine(var PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; BestPriceListLine: Record "Price List Line"): Boolean
FindLines(Enum Price Amount Type, Record Price List Line, Codeunit Price Calculation Buffer Mgt., Boolean) : Boolean#
procedure FindLines(AmountType: Enum "Price Amount Type"; var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; ShowAll: Boolean): Boolean
CopyLinesBySource(Record Price List Line, Record Price Source, Codeunit Price Asset List, Record Price List Line) : Boolean#
procedure CopyLinesBySource(var PriceListLine: Record "Price List Line"; PriceSource: Record "Price Source"; var PriceAssetList: Codeunit "Price Asset List"; var TempPriceListLine: Record "Price List Line" temporary): Boolean
CopyLinesBySource(Record Price List Line, Record Price Source, Record Price Asset, Record Price List Line) : Boolean#
Summary: Copies price list lines filtered by both source and asset.
procedure CopyLinesBySource(var PriceListLine: Record "Price List Line"; PriceSource: Record "Price Source"; PriceAsset: Record "Price Asset"; var TempPriceListLine: Record "Price List Line" temporary): Boolean
Parameters:
PriceListLine: The price list line record with filters applied.PriceSource: The price source to filter by.PriceAsset: The price asset to filter by.TempPriceListLine: Temporary buffer to receive the copied lines.
Returns: True if lines were found and copied, false otherwise.
Remarks: Applies both source and asset filters to price list lines. Copies matching lines to temporary buffer. Restores original filters after copying. Core method for filtering price list lines by multiple criteria.
CalcBestAmount(Enum Price Amount Type, Codeunit Price Calculation Buffer Mgt., Record Price List Line) : Boolean#
procedure CalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line"): Boolean
Events#
OnAfterIsBetterLine(Record Price List Line, Enum Price Amount Type, Record Price List Line, Boolean) :#
[IntegrationEvent(true, false)]
local procedure OnAfterIsBetterLine(PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; BestPriceListLine: Record "Price List Line"; var Result: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterIsBetterLine', '', false, false)]
local procedure DoSomethingOnAfterIsBetterLine(PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; BestPriceListLine: Record "Price List Line"; var Result: Boolean)
begin
end;
OnAfterIsDegradedLine(Record Price List Line, Record Price List Line, Boolean) :#
Summary: Integration event raised after checking if a line is degraded compared to the best line.
[IntegrationEvent(true, false)]
local procedure OnAfterIsDegradedLine(PriceListLine: Record "Price List Line"; BestPriceListLine: Record "Price List Line"; var Result: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterIsDegradedLine', '', false, false)]
local procedure DoSomethingOnAfterIsDegradedLine(PriceListLine: Record "Price List Line"; BestPriceListLine: Record "Price List Line"; var Result: Boolean)
begin
end;
Parameters:
PriceListLine: The price list line being evaluated.BestPriceListLine: The current best price list line.Result: True if the line is degraded (less specific), false otherwise.
Remarks: Allows subscribers to add custom degradation checks. A degraded line has blanked values compared to the best line (e.g., blank currency, variant). Called after standard degradation checks complete.
OnAfterIsImprovedLine(Record Price List Line, Record Price List Line, Boolean) :#
Summary: Integration event raised after checking if a line is improved compared to the best line.
[IntegrationEvent(true, false)]
local procedure OnAfterIsImprovedLine(PriceListLine: Record "Price List Line"; BestPriceListLine: Record "Price List Line"; var Result: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterIsImprovedLine', '', false, false)]
local procedure DoSomethingOnAfterIsImprovedLine(PriceListLine: Record "Price List Line"; BestPriceListLine: Record "Price List Line"; var Result: Boolean)
begin
end;
Parameters:
PriceListLine: The price list line being evaluated.BestPriceListLine: The current best price list line.Result: True if the line is improved (more specific), false otherwise.
Remarks: Allows subscribers to add custom improvement checks. An improved line has more specific values than the best line (e.g., filled currency, variant). Called after standard improvement checks complete.
OnAfterPickBestLine(Enum Price Amount Type, Record Price List Line, Record Price List Line, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnAfterPickBestLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterPickBestLine', '', false, false)]
local procedure DoSomethingOnAfterPickBestLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean)
begin
end;
OnBeforeFindLines(Enum Price Amount Type, Record Price List Line, Codeunit Price Calculation Buffer Mgt., Boolean, Boolean, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeFindLines(AmountType: Enum "Price Amount Type"; var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; ShowAll: Boolean; var FoundLines: Boolean; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnBeforeFindLines', '', false, false)]
local procedure DoSomethingOnBeforeFindLines(AmountType: Enum "Price Amount Type"; var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; ShowAll: Boolean; var FoundLines: Boolean; var IsHandled: Boolean)
begin
end;
OnBeforePickBestLine(Enum Price Amount Type, Record Price List Line, Record Price List Line, Boolean, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnBeforePickBestLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnBeforePickBestLine', '', false, false)]
local procedure DoSomethingOnBeforePickBestLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var IsHandled: Boolean)
begin
end;
OnBeforeCalcBestAmount(Enum Price Amount Type, Codeunit Price Calculation Buffer Mgt., Record Price List Line) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeCalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnBeforeCalcBestAmount', '', false, false)]
local procedure DoSomethingOnBeforeCalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line")
begin
end;
OnApplyDiscountOnBeforeFillBestLine(Record Price List Line, Codeunit Price Calculation Buffer Mgt.) :#
[IntegrationEvent(false, false)]
local procedure OnApplyDiscountOnBeforeFillBestLine(var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnApplyDiscountOnBeforeFillBestLine', '', false, false)]
local procedure DoSomethingOnApplyDiscountOnBeforeFillBestLine(var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt.")
begin
end;
OnIsDisabled(Boolean) :#
Summary: Integration event to check if the price calculation method is disabled.
[IntegrationEvent(false, false)]
local procedure OnIsDisabled(var Disabled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnIsDisabled', '', false, false)]
local procedure DoSomethingOnIsDisabled(var Disabled: Boolean)
begin
end;
Parameters:
Disabled: Set to true to disable this price calculation method.
Remarks: Allows subscribers to conditionally disable the KUMAVISION Price Priorities calculation method. Called during setup to determine if the method should be available. Use for license checks or feature toggles.
OnAfterFindLines(Enum Price Amount Type, Record Price List Line, Codeunit Price Calculation Buffer Mgt., Boolean, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnAfterFindLines(AmountType: Enum "Price Amount Type"; var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; ShowAll: Boolean; var FoundLines: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterFindLines', '', false, false)]
local procedure DoSomethingOnAfterFindLines(AmountType: Enum "Price Amount Type"; var TempPriceListLine: Record "Price List Line" temporary; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; ShowAll: Boolean; var FoundLines: Boolean)
begin
end;
OnBeforeShowPrices(Record Price List Line, Interface Line With Price) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeShowPrices(var TempPriceListLine: Record "Price List Line"; LineWithPrice: Interface "Line With Price"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnBeforeShowPrices', '', false, false)]
local procedure DoSomethingOnBeforeShowPrices(var TempPriceListLine: Record "Price List Line"; LineWithPrice: Interface "Line With Price")
begin
end;
OnFindLinesOnBefoerPriceSourceListGetMinMaxLevel(Codeunit Price Asset List, Codeunit Price Source List, Enum Price Amount Type, Codeunit Price Calculation Buffer Mgt.) :#
[IntegrationEvent(false, false)]
local procedure OnFindLinesOnBefoerPriceSourceListGetMinMaxLevel(var PriceAssetList: Codeunit "Price Asset List"; var PriceSourceList: Codeunit "Price Source List"; AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnFindLinesOnBefoerPriceSourceListGetMinMaxLevel', '', false, false)]
local procedure DoSomethingOnFindLinesOnBefoerPriceSourceListGetMinMaxLevel(var PriceAssetList: Codeunit "Price Asset List"; var PriceSourceList: Codeunit "Price Source List"; AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt.")
begin
end;
OnAfterCalcBestAmount(Enum Price Amount Type, Codeunit Price Calculation Buffer Mgt., Record Price List Line, Boolean) :#
[IntegrationEvent(true, false)]
local procedure OnAfterCalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line"; var FoundBestPrice: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterCalcBestAmount', '', false, false)]
local procedure DoSomethingOnAfterCalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line"; var FoundBestPrice: Boolean)
begin
end;
OnAfterReplaceifMoreSpecific(Enum Price Amount Type, Record Price List Line, Record Price List Line, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnAfterReplaceifMoreSpecific(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterReplaceifMoreSpecific', '', false, false)]
local procedure DoSomethingOnAfterReplaceifMoreSpecific(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean)
begin
end;
OnBeforeCalcBestAmountLine(Enum Price Amount Type, Record Price List Line, Record Price List Line, Boolean, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeCalcBestAmountLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var KVSKBANotFindBestPrice: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnBeforeCalcBestAmountLine', '', false, false)]
local procedure DoSomethingOnBeforeCalcBestAmountLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var KVSKBANotFindBestPrice: Boolean)
begin
end;
OnAfterCalcBestAmountLine(Enum Price Amount Type, Record Price List Line, Record Price List Line, Boolean, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnAfterCalcBestAmountLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var KVSKBANotFindBestPrice: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnAfterCalcBestAmountLine', '', false, false)]
local procedure DoSomethingOnAfterCalcBestAmountLine(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"; var BestPriceListLine: Record "Price List Line"; var FoundBestLine: Boolean; var KVSKBANotFindBestPrice: Boolean)
begin
end;
OnKVSKBACollectHierachyLevelOnBeforeFindCustomerPriceGroup(Record Customer, Code[20], Code[20], Boolean) :#
Summary: Integration event raised before finding customer price group in hierarchy collection.
[IntegrationEvent(false, false)]
local procedure OnKVSKBACollectHierachyLevelOnBeforeFindCustomerPriceGroup(HierarchyCustomer: Record "Customer"; ItemCategoryCode: Code[20]; var CustPriceGrCode: Code[20]; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnKVSKBACollectHierachyLevelOnBeforeFindCustomerPriceGroup', '', false, false)]
local procedure DoSomethingOnKVSKBACollectHierachyLevelOnBeforeFindCustomerPriceGroup(HierarchyCustomer: Record "Customer"; ItemCategoryCode: Code[20]; var CustPriceGrCode: Code[20]; var IsHandled: Boolean)
begin
end;
Parameters:
HierarchyCustomer: The customer record from the hierarchy.ItemCategoryCode: The item category code to search for.CustPriceGrCode: Output: The customer price group code found.IsHandled: Set to true to skip standard price group search logic.
Remarks: Allows subscribers to implement custom customer price group finding logic. Called during sales hierarchy collection. Used for extensibility of KUMAVISION item category-based pricing. If IsHandled is set to true and CustPriceGrCode is filled, standard logic is skipped.
OnFindLinesOnBeforeCopyConditionLines(Record Price Calculation Buffer, Record Price List Line) :#
Summary: Integration event raised before copying KUMAVISION condition lines.
[IntegrationEvent(false, false)]
local procedure OnFindLinesOnBeforeCopyConditionLines(var KVSKBAPriceCalculationBuffer: Record "Price Calculation Buffer"; var TempPriceListLine: Record "Price List Line" temporary):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnFindLinesOnBeforeCopyConditionLines', '', false, false)]
local procedure DoSomethingOnFindLinesOnBeforeCopyConditionLines(var KVSKBAPriceCalculationBuffer: Record "Price Calculation Buffer"; var TempPriceListLine: Record "Price List Line" temporary)
begin
end;
Parameters:
KVSKBAPriceCalculationBuffer: The price calculation buffer with context.TempPriceListLine: Temporary price list line being processed.
Remarks: Allows subscribers to modify or enrich price list lines before condition line copying. Called during FindLines for each price list line. Specific to KUMAVISION condition-based pricing feature. Can be used to set custom fields or apply transformations.
OnFindLinesOnAfterCopyConditionLines(Record Price Calculation Buffer, Record Price List Line) :#
Summary: Integration event raised after copying KUMAVISION condition lines.
[IntegrationEvent(false, false)]
local procedure OnFindLinesOnAfterCopyConditionLines(var KVSKBAPriceCalculationBuffer: Record "Price Calculation Buffer"; var TempPriceListLine: Record "Price List Line" temporary):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcPricePrio", 'OnFindLinesOnAfterCopyConditionLines', '', false, false)]
local procedure DoSomethingOnFindLinesOnAfterCopyConditionLines(var KVSKBAPriceCalculationBuffer: Record "Price Calculation Buffer"; var TempPriceListLine: Record "Price List Line" temporary)
begin
end;
Parameters:
KVSKBAPriceCalculationBuffer: The price calculation buffer with context.TempPriceListLine: Temporary price list line after condition line processing.
Remarks: Allows subscribers to post-process price list lines after condition line copying. Called during FindLines after condition-based prices/discounts have been calculated. Specific to KUMAVISION condition-based pricing feature. Can be used for validation, logging, or applying final adjustments.