---
id: change/bcapps/9448
type: change
title: "#9448 [Extensibility Request] issue 30264: add and extend events in CalcBestDirectUnitCost"
summary: Two new integration events and an extended existing event provide customization points in purchase price selection logic, allowing subscribers to override minimum-quantity checks, best-price selection rules, and no-price fallback handling without duplicating internal loops.
tier: official
language: en
tags:
  - feature
  - main
  - bc30
  - codeunit purch. price calc. mgt.
system: purchasing
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:10:53.023Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 409230ab79d980c6e5bfb2f81b7ccaeb57cd6196
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9448
    title: "microsoft/BCApps#9448: [Extensibility Request] issue 30264: add and extend events in CalcBestDirectUnitCost"
    date: "2026-07-30"
    commit: 409230ab79d980c6e5bfb2f81b7ccaeb57cd6196
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/7010
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9448
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9448
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-30T19:22:58Z"
author: AleksandricMarko
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
  - event-request
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 1
  additions: 35
  deletions: 19
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/7010
    page: codeunit/7010
    type: codeunit
    id: 7010
    name: Purch. Price Calc. Mgt.
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641452
systems:
  - purchasing
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9448 [Extensibility Request] issue 30264: add and extend events in CalcBestDirectUnitCost

> Two new integration events and an extended existing event provide customization points in purchase price selection logic, allowing subscribers to override minimum-quantity checks, best-price selection rules, and no-price fallback handling without duplicating internal loops.

[Pull request](https://github.com/microsoft/BCApps/pull/9448) · merged into `main` (BC30) on 2026-07-30 by AleksandricMarko · 1 file (+35 -19), 1 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- OnCalcBestDirectUnitCostOnAfterIsInMinQty event lets subscribers override per-price minimum-quantity logic
- OnCalcBestDirectUnitCostOnBeforeCaseStatement event allows replacing best-price selection rules with IsHandled skip flag
- OnCalcBestDirectUnitCostOnBeforeNoPriceFound extended with SKU-related parameters for fallback cost interception
- Events expose PurchasePrice record and related state to reduce need for logic re-implementation
- Supports per-price-record customization in codeunit 7010 without modifying core loops

## AL objects touched

- [Codeunit 7010 "Purch. Price Calc. Mgt."](../../objects/codeunit/7010.md), Base Application: modified

## Context

- Work items: AB#641452
- Labels: Team: SCM, event-request
- Systems: purchasing

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
