---
id: change/bcapps/13460
type: change
title: "#13460 [Master] Fix Expense Agent account filters with special characters"
summary: Expense Agent now properly handles G/L account lookups when account names or descriptions contain special characters like apostrophes or parentheses by quoting and escaping filter expressions.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit create expense gl account
system: copilot
review:
  state: reviewed
  by: opus
  at: "2026-11-03T00:58:53.877Z"
  flags: []
generated:
  at: "2026-11-05T00:14:20.359Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 6969ad4f70a61c9099cfcaa4ef91c0bbaf338d2f
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13460
    title: "microsoft/BCApps#13460: [Master] Fix Expense Agent account filters with special characters"
    date: "2026-11-02"
    commit: 6969ad4f70a61c9099cfcaa4ef91c0bbaf338d2f
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/6971
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/expense-management/expense-agent-expense-reports
      title: Create and Submit Expense Reports in Expense Agent
      label: possibly related
      why: Documents Expense Agent account filtering for expense report creation and submission
      by: model
number: 13460
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13460
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-02T15:01:26Z"
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: 2
  additions: 50
  deletions: 1
  al: 1
apps:
  - ExpenseAgent
objects_touched:
  - key: codeunit/6971
    page: codeunit/6971
    type: codeunit
    id: 6971
    name: Create Expense GL Account
    app: ExpenseAgent
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 657205
systems:
  - copilot
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #13460 [Master] Fix Expense Agent account filters with special characters

> Expense Agent now properly handles G/L account lookups when account names or descriptions contain special characters like apostrophes or parentheses by quoting and escaping filter expressions.

[Pull request](https://github.com/microsoft/BCApps/pull/13460) · merged into `main` (BC30) on 2026-11-02 by Alexander-Ya · 2 files (+50 -1), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fixed account search filter to quote and escape embedded apostrophes
- Prevents localized descriptions with parentheses or apostrophes from being misinterpreted as filter operators
- Preserves case-insensitive matching and wildcard behavior
- Applies to both G/L account-name lookup and account-subcategory fallback paths
- Added regression tests for parentheses and apostrophes in both lookup scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 6971 "Create Expense GL Account"](../../objects/codeunit/6971.md), ExpenseAgent: modified

## Context

- Work items: AB#657205
- Labels: AL: Apps (W1), ExpenseManagement, Team: Finance
- Systems: copilot

## Possibly related

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

- [Create and Submit Expense Reports in Expense Agent](https://learn.microsoft.com/dynamics365/business-central/expense-management/expense-agent-expense-reports) — possibly related: Documents Expense Agent account filtering for expense report creation and submission (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).
