{"title":"Compiler Warning (future error) AL0606","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/diagnostics/diagnostic-al606/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/diagnostics/diagnostic-al606, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/diagnostics/diagnostic-al606","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"The 'with' statement is deprecated and will be removed for cloud development in a future release.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Compiler Warning (future error) AL0606","slug":"compiler-warning-future-error-al0606","at":0,"chars":1330},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":497,"chars":722},{"level":2,"title":"Related information","slug":"related-information","at":1219,"chars":111}],"text":"# Compiler Warning (future error) AL0606\n> NOTE\n> The AL diagnostics topics are in preview. If you have input for this topic, we'd love to hear from you. Use our GitHub repo to create a PR and add content to this topic by going to https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb. To read about contributing, see Contribute to the Help<../../help/contributor-guide#contributing>. Thanks!\nThe 'with' statement is deprecated and will be removed for cloud development in a future release.\n## How to fix this diagnostic?\nThis warning means the code uses a with statement, which is deprecated for cloud development and becomes an error in a future release. Removing with makes member access explicit and avoids ambiguity between record members and other variables.\nTo fix it, remove the with block and qualify each member with the record variable. The following example uses with:\n```al\nwith Customer do begin\n    Name := 'Adatum Corporation';\n    Validate(\"Credit Limit (LCY)\", 1000);\nend;\n```\nQualify each member instead:\n```al\nCustomer.Name := 'Adatum Corporation';\nCustomer.Validate(\"Credit Limit (LCY)\", 1000);\n```\nVisual Studio Code also offers a Quick Fix code action that removes with statements for you.\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}