Reply To: How to get GIT working on the NAV Developer Preview?

Network of MS Dynamics D365, AX, NAV, GP, SL, CRM, RMS, POS professionals Forums Reply To: How to get GIT working on the NAV Developer Preview?

#12380

Anne Smith
Participant

< ![CDATA[Hi Abigail, Well, basically, the support of GIT is in there, but you need to install the binaries of GIT for it to work. So that needs to be done first. But it’s not easy on the NAV Developer Preview VM on Azure, because it basically doesn’t allow you to download files with explorer. Basically, you need to get the downloads from http://git-scm.com/. But you will see this error when you try to do that:

Easy, right? Just add that to your trusted sites Well, think again. After some investigation, you’ll see it tries to download from github. Adding both github as this git-scm to your trusted sites will not help. You can, however, start to mingle with server settings – well, I mingle with PowerShell. So, you basically have to figure out what the real download is, which you can find here. Just copy the link that says “click here to download manually”. That one should give you a “github”-link. As the current one is:
https://github.com/git-for-windows/git/releases/download/v2.13.0.windows.1/Git-2.13.0-64-bit.exe.
You can download the file on some other machine and copy it to the VM. I download the file simply with PowerShell. Here is a script you would be able to just execute, and it will install git for you as well:
Invoke-WebRequest `
-Uri ‘https://github.com/git-for-windows/git/releases/download/v2.13.0.windows.1/Git-2.13.0-64-bit.exe’ `
-OutFile C:\DOWNLOAD\Git.exe
$Command = ‘ C:\DOWNLOAD\Git.exe /VERYSILENT’
cmd /C $Command
That’s it! In a way, you’re good to go now. Any new project that you start, just “Initialize Repository”

Although, Your first commit will fail
You’ll see when you want to check in, you need to set up “yourself” by providing the username and email to git. Which kind of makes sense, since you haven’t identified yourself yet. The easiest way is to execute these commands in the terminal:
git config –global user.email “you@example.com”
git config –global user.name “Your Name”
Like:

And yes, now you ARE good to go. At least for the most basic things. As said, I’m not going into that.
Github
So what about Github? Or what some call “remote” repositories. Well – VSCode supports that as well – and it’s easy. What I always do (and was thought by Soren :-)), is to clone a repo from github and go from there. I follow these steps.
1. CTRL+SHIFT+P
2. Enter “>git: clone”
3. Now you need the URL. Let’s just take the very repo that Microsoft uses to get information and such: https://github.com/microsoft/al
4. Next, you need to give a “Parent Directory” – basically where the files will be stored, like “C:\Repos”

The files will be downloaded to that folder, and you’re good to go to contribute. You can commit, and push the changes to github.
And that’s how you can get going on the NAV developer preview. So, don’t just try out the new “al” language .. also get familiar with VSCode – and its integration with GIT when you’re at it!

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 kinds of questions is .. the answer is always the same :-/:
Powershell
And apparently, I already blogged something really similar as well :-):
http://www.waldo.be/2015/07/09/start-nav-object-in-rtc-with-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 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 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]]>

Skip to toolbar