---
id: change/bcapps/13730
type: change
title: "#13730 [Expense Agent] Initialize missing vendor numbering after upgrade"
summary: A per-company upgrade initializes missing vendor number series for the Expense Agent, ensuring merchant-driven expense creation works after upgrades when defaults were applied but vendor numbering remained blank.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit create expense no. series
  - codeunit upgrade expense agent setup
  - page expense agent setup
  - page expense agent setup wizard
  - table expense agent setup
system: copilot
review:
  state: reviewed
  by: opus
  at: "2026-11-10T00:55:32.680Z"
  flags: []
generated:
  at: "2026-11-30T00:15:18.424Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 9accdfd6d55debfe1966b6ecc367f21b21d66a2e
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13730
    title: "microsoft/BCApps#13730: [Expense Agent] Initialize missing vendor numbering after upgrade"
    date: "2026-11-09"
    commit: 9accdfd6d55debfe1966b6ecc367f21b21d66a2e
    t: null
    quote: Existing companies can have default number series marked as applied while Expense Vendor Nos. remains blank.
links:
  learn: []
  objects:
    - object/codeunit/6972
    - object/codeunit/6978
    - object/page/6996
    - object/page/6991
    - object/table/6930
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/ui-create-number-series
      title: Create number series
      label: possibly related
      why: Documents creating and managing number series for vendors and sequential identification codes.
      by: model
number: 13730
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13730
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-09T23:20:33Z"
author: Alexander-Ya
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - ExpenseManagement
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 7
  additions: 423
  deletions: 30
  al: 5
apps:
  - ExpenseAgent
objects_touched:
  - key: codeunit/6972
    page: codeunit/6972
    type: codeunit
    id: 6972
    name: Create Expense No. Series
    app: ExpenseAgent
    status: modified
  - key: codeunit/6978
    page: codeunit/6978
    type: codeunit
    id: 6978
    name: Upgrade Expense Agent Setup
    app: ExpenseAgent
    status: modified
  - key: page/6996
    page: page/6996
    type: page
    id: 6996
    name: Expense Agent Setup
    app: ExpenseAgent
    status: modified
  - key: page/6991
    page: page/6991
    type: page
    id: 6991
    name: Expense Agent Setup Wizard
    app: ExpenseAgent
    status: modified
  - key: table/6930
    page: table/6930
    type: table
    id: 6930
    name: Expense Agent Setup
    app: ExpenseAgent
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 13731
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/13731
fixes_issues: []
work_items:
  - 658051
systems:
  - copilot
quote: Existing companies can have default number series marked as applied while Expense Vendor Nos. remains blank.
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #13730 [Expense Agent] Initialize missing vendor numbering after upgrade

> A per-company upgrade initializes missing vendor number series for the Expense Agent, ensuring merchant-driven expense creation works after upgrades when defaults were applied but vendor numbering remained blank.

[Pull request](https://github.com/microsoft/BCApps/pull/13730) · merged into `main` (BC30) on 2026-11-09 by Alexander-Ya · 7 files (+423 -30), 5 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Adds a tagged per-company upgrade step to the existing upgrade codeunit that fills only blank Expense Vendor Nos. values
- Vendor-only initializer preserves configured number series and existing counters
- Repairs the same missing value through default settings and the setup wizard
- Enables the default-settings action when the vendor numbering field is empty
- Adds tests for upgrade, number series preservation and merchant expense creation (not yet run per the description)
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 6972 "Create Expense No. Series"](../../objects/codeunit/6972.md), ExpenseAgent: modified
- [Codeunit 6978 "Upgrade Expense Agent Setup"](../../objects/codeunit/6978.md), ExpenseAgent: modified
- [Page 6996 "Expense Agent Setup"](../../objects/page/6996.md), ExpenseAgent: modified
- [Page 6991 "Expense Agent Setup Wizard"](../../objects/page/6991.md), ExpenseAgent: modified
- [Table 6930 "Expense Agent Setup"](../../objects/table/6930.md), ExpenseAgent: modified

## Also merged into

- [#13731](https://github.com/microsoft/BCApps/pull/13731) into `releases/29.x` on 2026-11-09

## Context

- Work items: AB#658051
- Labels: AL: Apps (W1), ExpenseManagement, Team: Finance
- Systems: copilot
- From the description: "Existing companies can have default number series marked as applied while Expense Vendor Nos. remains blank."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Create number series](https://learn.microsoft.com/dynamics365/business-central/ui-create-number-series) — possibly related: Documents creating and managing number series for vendors and sequential identification codes. (model-linked)

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).
