Publish & Run Current Object from VSCode – with a single command

I’m not writing a blog about every single (new) command in my “CRS AL Language Extension”. But this Sunday, I added an interesting one. One that I should have had created for a long time – but simply didn’t think of it, until Daniel ( explicitly asked for it on GitHub.
Just imagine, you’re building an app, with many pages, and you want to build a page, test it, build the next one, test it .. . You kind have to:
– Publish the app
– Run the object after the app was published
The request was simple: combine both steps in one command in VSCode:

Publish & Run Current Object

And personally, I have been using it all day :-). So I thought – let’s just share it, so people know it exists and don’t have to find out by accidentally running into it ;-).

How to run it

Well, it’s simple, just:

What does it do .. exactly!

Well, it IS going to run a command from the “AL Language” extension first. The exact statement is this one:

The reason why I’m running the “without debugging” version, is because it’s the only way for me to mitigate that 2 browser tabs will be opened. Because the publish-step will open a tab, and then the “Run Object” (which is simply opening an URL) will open another tab.
You might say: “dude, you got a setting for that in the launch.json”. And you are right. In the launch.json, we can set the launchbrowser to “false”:

But …
This only works with the command “publish without debugging”, not with the normal F5. So .. that’s why I’m using this command ;-).

Keyboard Shortcut

You might have been using the “Run Current Object” already in the past.

Well, this still exists, and has a keyboard shortcut for it. I didn’t do that for the new command, but do know, you can do that yourself! You can even take this keyboard shortcut, and attach it to this new command.
Simply go into

Find the command and press the “+” sign on the left of it

Now, press the keyboard shortcut that works best for you – you can even override another one, like I did here to override the already existing “Run Current Object” shortcut:

Now you’re done.


Comment List