Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
APPLIES TO: Business Central 2020 release wave 2 and later
The #pragma implicitwith directive controls whether the compiler creates an implicit with context. Place the directive before an object declaration. By using #pragma implicitwith disable, unqualified references that rely on an implicit record no longer resolve and must be qualified, for example with Rec.. The setting applies to following object declarations until another #pragma implicitwith directive changes or restores it.
In the app.json file, you can set the NoImplicitWith flag to disable implicit with when you rewrite all code. Learn more about configuring compiler features in JSON files.
Note
By using Business Central 2022 release wave 2, the AL: Go! template adds NoImplicitWith to the features property in the generated app.json file. This setting disables implicit with contexts and requires affected references to be qualified.
Important
The compiler warns that implicit with will be removed in the future. Treat this directive as a temporary migration aid and qualify affected references. Learn more in Deprecating explicit and implicit with statements.
Syntax
#pragma implicitwith enable
#pragma implicitwith disable
#pragma implicitwith restore
enable enables implicit-with binding, even when NoImplicitWith is set globally. disable disables implicit-with binding. restore returns to the setting specified by the extension's compiler features.
Example
Learn more about updating affected code in Deprecating explicit and implicit with statements.
Related information
Development in AL
AL development environment
Pragma directive in AL
Conditional directives
Deprecating explicit and implicit with statements