---
id: change/bcapps/11381
type: change
title: "#11381 Slice 641293: [Expense Agent] Expense Locations and Per-diem rules in configuration - added check for existing country"
summary: Expense Agent setup now skips creating expense locations, rule conditions and rule headers for country and currency codes that do not exist. This avoids failures in customer databases that hold less data than the demo data.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit create expense locations
  - codeunit create expense rule conditions
  - codeunit create expense rule headers
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:05:13.165Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 234b95f973e19a099d50daaf099de10f6181f8ea
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11381
    title: "microsoft/BCApps#11381: Slice 641293: [Expense Agent] Expense Locations and Per-diem rules in configuration - added check for existing country"
    date: "2026-09-14"
    commit: 234b95f973e19a099d50daaf099de10f6181f8ea
    t: null
    quote: Skip creation for setup for non-existing country- and currency codes
links:
  learn: []
  objects:
    - object/codeunit/7124
    - object/codeunit/7126
    - object/codeunit/7128
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 11381
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11381
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-14T14:31:22Z"
author: BardurKnudsen
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 19
  deletions: 0
  al: 3
apps:
  - ExpenseAgent
objects_touched:
  - key: codeunit/7124
    page: codeunit/7124
    type: codeunit
    id: 7124
    name: Create Expense Locations
    app: ExpenseAgent
    status: modified
  - key: codeunit/7126
    page: codeunit/7126
    type: codeunit
    id: 7126
    name: Create Expense Rule Conditions
    app: ExpenseAgent
    status: modified
  - key: codeunit/7128
    page: codeunit/7128
    type: codeunit
    id: 7128
    name: Create Expense Rule Headers
    app: ExpenseAgent
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641293
systems:
  - development
quote: Skip creation for setup for non-existing country- and currency codes
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #11381 Slice 641293: [Expense Agent] Expense Locations and Per-diem rules in configuration - added check for existing country

> Expense Agent setup now skips creating expense locations, rule conditions and rule headers for country and currency codes that do not exist. This avoids failures in customer databases that hold less data than the demo data.

[Pull request](https://github.com/microsoft/BCApps/pull/11381) · merged into `main` (BC30) on 2026-09-14 by BardurKnudsen · 3 files (+19 -0), 3 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Added validation to skip expense location setup for non-existing country codes
- Added validation to skip expense rule condition setup for missing data
- Added validation to skip expense rule header setup for missing data
- Prevents creation failures in customer databases with less data than demo data
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 7124 "Create Expense Locations"](../../objects/codeunit/7124.md), ExpenseAgent: modified
- [Codeunit 7126 "Create Expense Rule Conditions"](../../objects/codeunit/7126.md), ExpenseAgent: modified
- [Codeunit 7128 "Create Expense Rule Headers"](../../objects/codeunit/7128.md), ExpenseAgent: modified

## Context

- Work items: AB#641293
- Labels: AL: Apps (W1), Team: Finance
- Systems: development
- From the description: "Skip creation for setup for non-existing country- and currency codes"

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