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.
Note
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 here. To read about contributing, see Contribute to the Help. Thanks!
The 'with' statement is deprecated and will be removed for cloud development in a future release.
How to fix this diagnostic?
This 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.
To fix it, remove the with block and qualify each member with the record variable. The following example uses with:
with Customer do begin
Name := 'Adatum Corporation';
Validate("Credit Limit (LCY)", 1000);
end;
Qualify each member instead:
Customer.Name := 'Adatum Corporation';
Customer.Validate("Credit Limit (LCY)", 1000);
Visual Studio Code also offers a Quick Fix code action that removes with statements for you.