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

Hello Experts,

I am getting below warning in AL

“Use of implicit ‘with’ will be removed in the future. Qualify with ‘Rec.’. This warning will become an error in a future release. AL(AL0604)”

Can anyone let me know what will be the issue?

I’m seeing this error now too. Looking for Expert guidance as well. Thank you!

It is correct. Microsoft is going to “retire” the use of implicit ‘with’ statements in the future.

Although I personally have used them a lot and praised the use of them. But Microsoft is completely right that they impose a problem. A problem which is only getting bigger in the cloud world.

You can read more about it in [mention:5274b27da73b40878de2174a14bd9e2e:ca0e7c8086864d2fa5a863b9e212e922]:

[View:~/nav/b/demiliani/posts/dynamics-365-business-central-obsoleting-the-with-statement:320:50]

Hi Erik,

I have red this github "https://github.com/microsoft/AL/issues/5916" and it seems like it has something to do with version of AL. Do you agree with this? I am still looking some work around for this and not so sure that version upgrade can fix this issue.

I was getting this warning for field added in extended page. What is your suggestion?

Thank you

This came out a few months ago, I wrote about it (http://thedenster.com/bye-bye-with), as did other people

The AL CodeActions extension has a function to help you fix it.

You could disable rule in your ruleset, but at some point you must address the issues because they will get rid of WITH in about a year.

Hi Daniel,

So in that case do we need to add “Rec.” whenever be we are going to add field in page extension?

I was disabled this AL CodeAction but still having the same issue.

Thank you

Correct. In the new situation, you must specify the record as well as the field. In a page extension that means that you will need to specify Rec when you are doing something with any of the record’s fields. The AL CodeActions extension can do it for an entire object, which is very useful when you have to fix a lot of objects.

Hi Daniel,

Would you tell me where I need to do the modification that will really help me a lot. I saw that CodeAction have 2 commands but I not sure how i can execute those?

Thank you

Click on the problem in the problems window, and VSCode will take you right where the problem is, and you can fix it there. You execute commands in VSCode from the Command palette (Ctrl + Shift + P).

If you need some help on how to work with VSCode, there is about 20 hours of training for AL development on YouTube - www.youtube.com/playlist

There’s another VSCode extension that has a function to address the WITH situation:

Thank you so much Daniel. Much Appreciated.

Issue has been fixed. Thank you so much Daniel.

You’re welcome, glad to hear you were able to fix that