Replace Special Character With Similar Character in Business Central

Special characters can feel like a small detail in Business Central, but they often cause the biggest headaches.

An accented letter in a customer name or a symbol in a product field is enough to disrupt a file export, block a CSV import, or create mismatches during an integration.

In this blog post, we’ll cover how to replace a special character with a similar character in Business Central and improve data consistency across Dynamics 365 Solutions. Let’s get started!

Key Takeaways

Follow these steps to replace a special character with a similar character in Business Central:
  • Identify issues: Scan common fields, such as customer names, item descriptions, and journal entries for accents, commas, quotes, or symbols.
  • Choose a method:
    • Use CONVERTSTR to replace recurring characters (e.g., commas → hyphens).
    • Use Text.Replace to swap substrings or single characters (e.g., & → and).
    • Use DelChr to remove unwanted characters completely (e.g., quotes).
  • Apply before export: Run replacements during data exports or integrations to prevent CSV/Excel issues.
  • Log replacements: Keep an audit trail showing which characters were replaced or removed.
  • Automate with AL code: Configure cleanup routines that trigger automatically on exports or integrations.
  • Standardize safe characters: Define consistent substitutions (e.g., hyphens for commas, plain text for quotes).

Why Special Characters Cause Export/Import Issues

Special characters often create trouble during exports and imports in Microsoft Dynamics 365 Business Central. They don’t always display problems on screen, but once data is exported to a CSV or integrated with another system, they can distort fields and generate errors.

Here are the most common issues:

  • A comma inside a text field shifts values into the next column during CSV export, breaking the file structure
  • A dot or symbol inside a numeric field confuses the system, leading to misaligned or invalid data
  • Accented letters in names or product details stop imports in connected systems that cannot recognize those characters
  • File integrations fail when one system interprets a character differently than Business Central, creating mismatched or missing records

Common Scenarios Where You Need To Replace Special Characters

Here are some scenarios where learning how to replace a special character with a similar character becomes necessary:

Master Data Exports

A customer name like José Martínez or an item description containing symbols such as 50” LED Display can cause issues in CSV exports. The accent in José or the quotation mark in 50” may shift columns or appear as unreadable text in downstream systems.

Journal Entries and Financial Exports

Amounts sometimes include unexpected commas or spaces, such as 1,500.00.

When exported, these values may split into two columns (1 and 500.00), producing incorrect totals and errors during reconciliation.

File Integrations

External systems consuming CSV or Excel files often reject fields containing characters, such as& or %.

For example, an item code A&B-100 may be treated as multiple fields, breaking the integration and blocking the import process.

Built-In BC Methods For Replacing Characters

Business Central methods to replace characters

The following functions help you replace special characters in Business Central and keep your data consistent:

CONVERTSTR Function

The CONVERTSTR function is designed to replace one character with another throughout a string. It’s simple, fast, and works well for large datasets.

Syntax

CONVERTSTR(String, OldChar, NewChar)

Example

CONVERTSTR(‘Product, Description’, ‘,’, ‘-‘)

This converts Product, Description into Product- Description, replacing the comma with a hyphen.

When to Use

CONVERTSTR is ideal for scenarios where a single, recurring character causes export or import issues.

For instance, if commas in item descriptions break CSV exports, using CONVERTSTR ensures all commas are replaced with safe characters before the file leaves Business Central. It’s a go-to method for bulk replacements in master data or transactional exports.

Pro Tip: Keep a log table of every replacement or removal that runs during exports. This gives you an audit trail if stakeholders ask why customer data looks slightly different in external systems.

Text.Replace Method

Text.Replace handles more complex scenarios by replacing both single characters and substrings across string fields.

Example

Text.Replace(‘José & Martínez’, ‘&’, ‘and’)

The output becomes José and Martínez, removing the ampersand that could be rejected by external systems.

When to Use

Use Text.Replace when special characters appear as part of substrings that need standardization. This method works well for customer names, item descriptions, or notes that move across different systems.

DelChr for Removing Characters

DelChr removes unwanted characters entirely instead of replacing them.

Example

DelChr(’50” LED Display’, ‘”‘)

The result is 50 LED Display, eliminating the quotation mark.

When to Use

Use DelChr for characters that cannot appear in target systems, such as quotes, backslashes, or symbols that break CSV formatting. Combining DelChr with other cleanup methods ensures thorough Business Central string cleanup and prevents errors in exports, imports, and integrations.

Pro Tip: Old records may contain characters that break current exports or reporting. Regularly audit past entries and apply cleanup rules where needed.
Partner with Aegis Softtech to run historical data audits and implement corrective actions.

Best Practices and Tips To Avoid Data Issues

Follow these best practices to reduce errors and make Business Central string cleanup more reliable.

Validate Data Before Export

Running validations ensures you catch invalid characters before they create problems in a CSV or Excel file.

Scan the most common fields where issues appear. For example, customer names, item descriptions, and journal entries often include symbols or accents that need cleanup. Typical validation steps include:

  • Scan target fields for known problematic characters
  • Highlight or log records that contain invalid entries
  • Apply the replace special character in Business Central methods to clean flagged values before processing

Use Configuration to Automate Cleanup

Manual review leaves too much room for error. Automating character cleanup creates a safeguard that runs every time data moves through exports or imports.

Configuration through AL code in Business Central or system rules ensures consistency and reduces repetitive effort. A common setup might include:

  • Defining replacement rules for symbols across master data
  • Running how to replace special character with similar character during export routines
  • Scheduling automated cleanup jobs for recurring integrations

Use Safe Characters and Avoid Problematic Ones

Plan safe substitutions to keep data compatible across systems. For example, commas split CSV fields, quotation marks interrupt parsing, and symbols like ampersands are often rejected.

What to avoid and use in Business Central

Safer alternatives include:

  • Hyphens or spaces in place of commas
  • Plain text replacements for quotation marks
  • Full words (such as and) to replace special symbols

Maintain Consistency

Replacements should follow a clear set of rules. Inconsistent handling confuses users and leads to errors in downstream systems.

To prevent that, define where and how replacements should apply, such as:

  • Limit replacements to specific fields like item descriptions
  • Remove unwanted characters only in certain positions (e.g., trailing symbols)
  • Document a standard Business Central string cleanup approach for your team

Train Users on Safe Entry Practices

Many issues start at the data entry stage. Educating users reduces the number of invalid characters entering the system in the first place.

Training efforts can focus on:

  • Clear guidelines on what characters are acceptable
  • Inline validations that alert users when they enter problematic values
  • Reinforcing consistency during bulk uploads and master data entry

Keep Your Business Central Data Clean and Reliable with Aegis Softtech

Special characters often break exports and integrations in Business Central. A comma in a customer name or an extra symbol in a journal entry can shift CSV fields and cause failed transfers.

The fix lies in clear replacement rules, consistent character handling, and automation that catches issues before they spread.

Aegis Softtech’s Business Central Consultant helps you put these practices in place. Our Microsoft Business Central developers set up field validation, configure cleanup methods, and apply rules that keep data consistent across master records, journal entries, and integrations.

Work with us to remove recurring data problems and keep your Business Central environment reliable.
Schedule a consultation today!

FAQs

1. How to use CONVERTSTR in Business Central to replace characters?

Use CONVERTSTR when you want to replace one set of characters with another across a string.

For example: CONVERTSTR(CustomerName, ‘,’, ‘-‘)

This replaces every comma in the field with a dash. It works best when you need a one-to-one mapping between characters during Business Central string cleanup.

2. When to use Text.Replace vs CONVERTSTR vs DelChr in BC?

  • Use CONVERTSTR when you want to replace multiple characters with mapped alternatives in one go
  • Use Text.Replace when you want to replace a single character or substring across a field, like changing ‘&’ into ‘and’
  • Use DelChr when you need to remove special characters altogether, not replace them

3. How to automate the cleaning of special characters before file export?

Set up a process in AL that runs before export routines. You can combine CONVERTSTR or Text.Replace in codeunits that handle customer names, item descriptions, or journal entries. Define the rules once, and they apply every time data is exported.

4. What are the risks if special characters aren’t handled in CSV/Excel exports?

Unprocessed special characters can:

  • Misplace fields in CSV files, shifting values into the wrong columns
  • Cause file import errors in external systems
  • Generate inaccurate financial reports or transaction mismatches
  • Break integrations where the receiving system rejects unsupported symbols
Avatar photo

Sandip Sodha

Sandip Sodha is an experienced Microsoft Dynamics Business Central consultant. with the strong foundation in the concept, he knows how to make businesses run smoothly and works with organizations to create solutions that remove inefficiencies, simplify workflows, and bring real results. Sandeep is known for his clear strategy and focus on results. He ensures every Business Central rollout supports the company’s bigger goals, helping businesses grow, remain flexible, and succeed in a challenging market.

Scroll to Top