Показать сообщение отдельно
Старый 14.06.2017, 04:17   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
waldo: AL with VSCode: Run Extension Objects (with PowerShell)
Источник: https://dynamicsuser.net/nav/b/waldo...ith-powershell
==============

Some time ago, Mark blogged an interesting article about running objects from extensions. You can read it here: https://markbrummel.blog/2017/05/20/...nsion-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 :-/:

Powershell

And apperantly, I already blogged something really similar as well :-):

http://www.waldo.be/2015/07/09/start...th-powershell/

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 70000000Running a table:

Start-NAVApplicationObjectInWindowsClient ` -ServerInstance NAV ` -ObjectType table ` -ObjectID 70055050Works 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 700500000You 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

Enjoy!




Источник: https://dynamicsuser.net/nav/b/waldo...ith-powershell
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.