Some time ago, Mark blogged an interesting article about running objects from extensions. You can read it here: https://markbrummel.blog/2017/05/20/tip-58-run-extension-objects/ .
It made me wonder .. how would I solve this? And one of the problems of asking myself these kind of questions is .. the answer is always the same :-/:
And apperantly, I already blogged something really similar as well :-):
I created some functions in my module to be able to run objects in a windows client. This enables me to do something like this:
Running a codeunit:
Start-NAVApplicationObjectInWindowsClient ` -ServerInstance NAV ` -ObjectType Codeunit ` -ObjectID 70000000
Running a table:
Start-NAVApplicationObjectInWindowsClient ` -ServerInstance NAV ` -ObjectType table ` -ObjectID 70055050
Works like a charm for Extension objects as well :-).
What about the Web Client?
Well .. Duh ;-). Only, the Web Client only supports to be able to run a Page or a Report. So in the latest version of my Powershell-modules, I included a function to support that: Start-NAVApplicationObjectInWebClient.
It’s very the same as the other Start-function – here is an example:
Start-NAVApplicationObjectInWebClient ` -WebServerInstance DynamicsNAV100 ` -WebClientType Tablet ` -ObjectType Page ` -ObjectID 700500000
You can see it supports also running the tablet client and the phone client. How easy can it get? 😉
So, I need to have a new project with powershell-stuff to combine with my AL development?
Most certainly not! You can easily combine powershell-scripts with al-development! Just take this screenshot as an example:
This is just a simple example where I included a PowerShell-script in a subfolder of the workspace of an al-project. It keeps being an al-project (mind the “launch.json”, but I’m able to execute Powershell as part of the workspace. Not with F5, but with F8 (execute the selection).
How do i make your modules available on my system
Making my modules available on your machine you can do simply by installing them from the PowerShell Gallery by executing this :
Find-Module | where author -eq waldo | install-module
[…] Bron : Waldo’s Blog Lees meer… […]
[…] by Eric Wauters’ (waldo) as always very good blog post about how to run objects in VS Code through PowerShell I added a […]