{"title":"Compiler Error AL0118","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/diagnostics/diagnostic-al118/","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-al118, 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-al118","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 name '{0}' does not exist in the current context.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Compiler Error AL0118","slug":"compiler-error-al0118","at":0,"chars":1368},{"level":2,"title":"Description","slug":"description","at":436,"chars":74},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":510,"chars":747},{"level":2,"title":"Related information","slug":"related-information","at":1257,"chars":111}],"text":"# Compiler Error AL0118\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 name '{0}' does not exist in the current context.\n## Description\nThe referenced name does not exist in the current context.\n## How to fix this diagnostic?\nThe compiler can't resolve the name at the reported position. It isn't declared, it's out of scope, or it comes from a dependency you haven't referenced.\nTo fix it:\n1. Check the spelling and quoting of the name. Names with spaces or special characters must be quoted, for example `\"No. Series\"`.\n2. Make sure the variable, parameter, or method is declared and in scope.\n3. If the name belongs to another extension, add that extension to the dependencies in app.json.\n4. Use IntelliSense or Go to Definition (F12) to confirm the symbol exists and is accessible.\n```al\nvar\n    Cust: Record Customer;\nbegin\n    // 'Customr' is misspelled -> AL0118\n    Customr.FindFirst();\n    // Correct\n    Cust.FindFirst();\nend;\n```\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}