Table of Contents

KVSKBASavePurchPriceLineDisc

Events

OnPurchPriceCreationOnBeforePurchPriceTypeCaseElse(Record KVSKBAPurchasePrice, Record Purchase Line) :

OBSOLETE

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

Summary: Integration event raised in PurchPriceCreation when the PurchasePrice type does not match any of the handled cases (neither Item nor Item Price Group).

[Obsolete('The price calculation needs a redesign due to the standard changes, possibly the function will not be available in the future.', '18.3')]
[IntegrationEvent(false, false)]
local procedure OnPurchPriceCreationOnBeforePurchPriceTypeCaseElse(var PurchasePrice: Record "KVSKBAPurchasePrice"; var TempPurchaseLine: Record "Purchase Line" temporary): 

Parameters:

  • PurchasePrice: The purchase price record being built for the current purchase line.
  • TempPurchaseLine: The temporary purchase line being processed.

Remarks: Subscribe to this event to handle custom or extended price types that are not covered by the standard case statement. Note: This event is obsolete and may be removed in a future version due to the redesign of the price calculation.

OnBeforeSavePurchasePrice(Record Purchase Line, Code[20], Boolean, Boolean) :

Summary: Integration event raised at the beginning of SavePurchasePrice, before any price list lines are created.

[IntegrationEvent(false, false)]
local procedure OnBeforeSavePurchasePrice(var TempPurchaseLine: Record "Purchase Line"; DefPricePriceListCode: Code[20]; MultipleVendorExist: Boolean; var IsHandled: Boolean): 

Parameters:

  • TempPurchaseLine: The temporary purchase lines selected for saving prices.
  • DefPricePriceListCode: The price list code selected by the user for the price save.
  • MultipleVendorExist: Indicates whether the selected purchase lines originate from multiple vendors.
  • IsHandled: Set to true to skip the standard save logic and handle it entirely in the subscriber.

Remarks: Subscribe to this event to override or extend the purchase price saving logic before price list lines are inserted.

OnSavePurchasePriceOnBeforePriceListLineInsert(Record Purchase Line, Record Price List Line, Boolean) :

Summary: Integration event raised in SavePurchasePrice immediately before each price list line is inserted.

[IntegrationEvent(false, false)]
local procedure OnSavePurchasePriceOnBeforePriceListLineInsert(var TempPurchaseLine: Record "Purchase Line"; var PriceListLine: Record "Price List Line"; MultipleVendorExist: Boolean): 

Parameters:

  • TempPurchaseLine: The temporary purchase line for which the price list line is being created.
  • PriceListLine: The price list line that is about to be inserted. Can be modified in the subscriber.
  • MultipleVendorExist: Indicates whether the selected purchase lines originate from multiple vendors.

Remarks: Subscribe to this event to add, change, or validate fields on the price list line before it is inserted into the database.

OnBeforeSavePurchaseDiscount(Record Purchase Line, Code[20], Boolean, Boolean) :

Summary: Integration event raised at the beginning of SavePurchaseDiscount, before any discount price list lines are created.

[IntegrationEvent(false, false)]
local procedure OnBeforeSavePurchaseDiscount(var TempPurchaseLine: Record "Purchase Line"; DefPricePriceListCode: Code[20]; MultipleVendorExist: Boolean; var IsHandled: Boolean): 

Parameters:

  • TempPurchaseLine: The temporary purchase lines selected for saving discounts.
  • DefPricePriceListCode: The price list code selected by the user for the discount save.
  • MultipleVendorExist: Indicates whether the selected purchase lines originate from multiple vendors.
  • IsHandled: Set to true to skip the standard save logic and handle it entirely in the subscriber.

Remarks: Subscribe to this event to override or extend the purchase discount saving logic before price list lines are inserted.

OnSavePurchaseDiscountOnBeforePriceListLineInsert(Record Purchase Line, Record Price List Line, Boolean) :

Summary: Integration event raised in SavePurchaseDiscount immediately before each discount price list line is inserted.

[IntegrationEvent(false, false)]
local procedure OnSavePurchaseDiscountOnBeforePriceListLineInsert(var TempPurchaseLine: Record "Purchase Line"; var PriceListLine: Record "Price List Line"; MultipleVendorExist: Boolean): 

Parameters:

  • TempPurchaseLine: The temporary purchase line for which the discount price list line is being created.
  • PriceListLine: The discount price list line that is about to be inserted. Can be modified in the subscriber.
  • MultipleVendorExist: Indicates whether the selected purchase lines originate from multiple vendors.

Remarks: Subscribe to this event to add, change, or validate fields on the discount price list line before it is inserted into the database.

OnBeforeFindPricingVendorwithPurchaseLine(Record Purchase Line, Code[20], Boolean) :

Summary: Integration event raised at the beginning of FindPricingVendorwithPurchaseLine, before the pricing vendor is determined from the purchase header.

[IntegrationEvent(false, false)]
local procedure OnBeforeFindPricingVendorwithPurchaseLine(TempFindPurchaseLine: Record "Purchase Line" temporary; var PricingVendorNo: Code[20]; var IsHandled: Boolean): 

Parameters:

  • TempFindPurchaseLine: The temporary purchase line from which the pricing vendor is to be determined.
  • PricingVendorNo: Return variable for the pricing vendor number. Set this in the subscriber when handling the event.
  • IsHandled: Set to true to skip the standard vendor lookup logic and use the value set in PricingVendorNo instead.

Remarks: Subscribe to this event to override how the pricing vendor is resolved for a given purchase line, for example when custom vendor selection logic is required.

OnBeforeFindPricingVendor(Record Purchase Line, Code[20], Boolean) :

Summary: Integration event raised at the beginning of FindPricingVendor, before the first purchase line is used to determine the default pricing vendor.

[IntegrationEvent(false, false)]
local procedure OnBeforeFindPricingVendor(var TempFindPurchaseLine: Record "Purchase Line" temporary; var PricingVendorNo: Code[20]; var IsHandled: Boolean): 

Parameters:

  • TempFindPurchaseLine: The temporary purchase lines buffer used to look up the pricing vendor.
  • PricingVendorNo: Return variable for the pricing vendor number. Set this in the subscriber when handling the event.
  • IsHandled: Set to true to skip the standard logic and use the value set in PricingVendorNo instead.

Remarks: Subscribe to this event to provide a custom default pricing vendor when the standard determination based on the purchase header's KVSKBAPricingVendor field is not sufficient.

OnBeforeTestPriceListHeaderValues(Code[20], Code[20], Date, Date, Boolean) :

Summary: Integration event raised at the beginning of TestPriceListHeaderValues, before the price list header is validated against the given parameters.

[IntegrationEvent(false, false)]
local procedure OnBeforeTestPriceListHeaderValues(PriceListLineCode: Code[20]; VendorNo: Code[20]; StartingDate: Date; EndingDate: Date; var IsHandled: Boolean): 

Parameters:

  • PriceListLineCode: The price list code to be validated.
  • VendorNo: The vendor number used as the source for the price list line validation.
  • StartingDate: The starting date to be validated against the price list header.
  • EndingDate: The ending date to be validated against the price list header.
  • IsHandled: Set to true to skip the standard validation logic and handle it entirely in the subscriber.

Remarks: Subscribe to this event to override or extend the price list header validation, for example to apply custom rules for specific price lists or vendors.