---
id: object/codeunit/4591
type: object
title: Codeunit 4591 "SOA Item Search"
summary: Codeunit 4591 "SOA Item Search" in SalesOrderAgent (Microsoft.Agent.SalesOrderAgent). 5 public procedures, 1 events, 6 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - salesorderagent
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: ae1bc411ef8724c1b9fc11f2bf1b851ccdbf156023c99753b16f5f4a15141295
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SalesOrderAgent/app/src/ItemSearch/SOAItemSearch.Codeunit.al
    title: src/Apps/W1/SalesOrderAgent/app/src/ItemSearch/SOAItemSearch.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11383
    - change/bcapps/11068
    - change/bcapps/10748
    - change/bcapps/10631
    - change/bcapps/9310
    - change/bcapps/9989
    - change/bcapps/9364
object_type: codeunit
object_id: 4591
name: SOA Item Search
namespace: Microsoft.Agent.SalesOrderAgent
app: SalesOrderAgent
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 32
  events: 1
  subscribers: 6
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 2
  implements: 0
---

# Codeunit 4591 "SOA Item Search"

> Codeunit 4591 "SOA Item Search" in SalesOrderAgent (Microsoft.Agent.SalesOrderAgent). 5 public procedures, 1 events, 6 event subscribers. Introduced in BC29, still in BC30.

SalesOrderAgent · Microsoft.Agent.SalesOrderAgent · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SalesOrderAgent/app/src/ItemSearch/SOAItemSearch.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Events published

- `OnAfterFindRecordItem(ItemFilter: Text; Which: Text; CrossColumnSearchFilter: Text; Found: Boolean; RequiredQuantity: Decimal; InUOMCode: Code[10])` (internal)

## Event subscriptions

- FindRecordItemFromList subscribes to Page "Item List" OnBeforeFindRecord
- FindRecordItemFromLookup subscribes to Page "Item Lookup" OnBeforeFindRecord
- FindRecordItemFromMultiItemsAvailability subscribes to Page "SOA Multi Items Availability" OnBeforeFindRecord
- LogInventoryInquiryReplied subscribes to Page "SOA Multi Items Availability" OnOpenPageEvent
- OnGetResolvedVariantCodeOnBeforeExit subscribes to Page "SOA Multi Items Availability" OnGetResolvedVariantCodeOnBeforeExit
- OnAfterCheckItemAvailable subscribes to Table "Sales Line" OnAfterCheckItemAvailable

## Procedures

- `SetAgentTaskID(NewAgentTaskID: BigInteger)`
- `GetItemFilters(var ItemFilter: Text; SearchPrimaryKeyWords: List of [Text])`
- `RemoveVariantlessMatchesWithConcreteAlternatives(MatchingItemFilter: Text; MatchingItemVariants: Dictionary of [Text, List of [Code[10]]]; AlternativeItemVariants: Dictionary of [Text, List of [Code[10]]]): Text` (internal)
- `AddVariantsToCandidateArray(ItemFilter: Text; var CandidateArray: JsonArray)` (internal)
- `CalcProjAvailableBalanceInUOM(Item: Record Item; ProjAvailableBalance: Decimal; LineUOM: Code[10]): Decimal` (internal)

Plus 20 local procedures.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 4413 "SOA Shipment Date Mgt."](../codeunit/4413.md) (4 calls: `OnAfterCheckItemAvailable → (object)`, `OnAfterCheckItemAvailable → GetEarliestShipmentDate`, `OnAfterCheckItemAvailable → OrderPromisingSetupConfigured`, …)
- [Codeunit 1511 "Notification Lifecycle Mgt."](../codeunit/1511.md) (2 calls: `OnAfterCheckItemAvailable → RecallNotificationsForRecordWithAdditionalContext`, `OnAfterCheckItemAvailable → SendNotificationWithAdditionalContext`)
- [Codeunit 353 "Item Availability Forms Mgt"](../codeunit/353.md) (1 call: `IsRequiredQuantityAvailable → CalcAvailQuantities`)
- [Codeunit 4400 "SOA Setup"](../codeunit/4400.md) (1 call: `LogTelemetryForFindItems → GetFeatureName`)
- [Codeunit 4417 "SOA Item Selector"](../codeunit/4417.md) (1 call: `SelectBestItem → SelectBestMatchingItems`)
- [Codeunit 4420 "SOA Task Message Reader"](../codeunit/4420.md) (1 call: `GetTaskMessageContent → GetLastIncomingMessageContent`)
- [Codeunit 4590 "SOA Billing"](../codeunit/4590.md) (1 call: `LogInventoryInquiryReplied → LogInventoryInquiryReplied`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (1 call: `LogTelemetryForFindItems → LogUsage`)

## Called by

- [Codeunit 4304 "SOA Session Events"](../codeunit/4304.md) (1 call: `SetupItemSearchEvents → SetAgentTaskID`)
- [Page 4410 "SOA Multi Items Availability"](../page/4410.md) (1 call: `CalcAvailQuantities → CalcProjAvailableBalanceInUOM`)

## Recent changes

- 2026-09-15 [#11383 [SOA] Fix "The Order Promising Setup does not exist." crash when setting quote quantity](../../changes/bcapps/11383.md) (main, BC30, fix)
- 2026-09-04 [#11068 SOA: Clear previous search filter](../../changes/bcapps/11068.md) (main, BC30, fix)
- 2026-08-28 [#10748 [SOA] Resolve the current agent's setup instead of an arbitrary one](../../changes/bcapps/10748.md) (main, BC30, fix)
- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-24 [#9310 SOA: Open Item Availability from Agent panel](../../changes/bcapps/9310.md) (main, BC30, feature)
- 2026-08-06 [#9989 [SOA] Skip Item Selector for exact items without variants](../../changes/bcapps/9989.md) (main, BC30, performance)
- 2026-08-05 [#9364 Slice 622414: [SOA] [Pioneer] Enhancing Sales Order Agent with Item Variant : availability and prices](../../changes/bcapps/9364.md) (main, BC30, feature)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "SOA Item Search")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
