Skip to content
Regex replacement in VS Code

How-To USE Search-and-Replace Regex in VS Code

Daniel Gorski
Daniel Gorski February 18, 2021
1 min read

How-To solve usage of implicit 'with' in VS Code (AL0604)

AL(AL0604):
Use of implicit 'with' will be removed in the future.
Qualify with Rec. – this warning will become an error in a future release.


Hey guys,

you might know that VS Code supports usage of search-and-replace with regular expressions?

If you want to know how this reg-ex works, just visit:
https://regex101.com/r/Rx7sPI/4

VS Code AL page editor showing the AL0604 tooltip warning about implicit 'with' usage on a field reference


Open your search dialog with CTRL+H

Empty Find and Replace dialog opened in VS Code with Ctrl+H

Use this in your Find field:

(\w*field\(.*; ?)(.*\))

And this in your Replace field:

$1Rec.$2

Then hit the "Use Regular Expression" button (ALT+R):

Find and Replace dialog with the regex search pattern and $1Rec.$2 replacement entered before enabling regex matching


Your matching lines will be marked:

AL code editor with all field lines matching the regex search pattern highlighted

Replace it – and you’re fine 😎

AL code editor after the replace, with Rec. now prefixed to every matched field reference

Related posts

▸ All posts
Split multiline comments in Business Central

Split Multiline Text into Records

June 28, 2022 · Daniel Gorski

Learn how to split long multiline text into comment records in Business Central using AL and Regex — including a working editor example and useful patterns.

Read More
Read More: Split Multiline Text into Records
TXT2AL conversion guide

How-To Solve your issues after TXT2AL

February 24, 2021 · Daniel Gorski

Learn how to fix common issues after converting C/AL to AL using TXT2AL – with regex, PowerShell scripts, and hands-on troubleshooting tips.

Read More
Read More: How-To Solve your issues after TXT2AL
Upload and download files via BLOB in Business Central

Upload and Download Files in a BC Blob Field

January 29, 2025 · Daniel Gorski

Learn how to upload and download files in Business Central using a custom AL page and a BLOB field—perfect for storing documents, images, and more.

Read More
Read More: How to Upload and Download Files in a Blob Field in Business Central