Quantcast
Channel: Waldo's Blog
Viewing all 339 articles
Browse latest View live

Remove all custom apps on Docker container (with PowerShell)

$
0
0

Today, I was prepping for my 2-day Masterclass about developing Extensions in Visual Studio Code. And finally, I made some time to make a first version of a function that I have been wanting for quite some time: a function to remove all the custom apps from a docker image.

What is the challenge?

Well, if you’re used to Extensions V1 – then you’ll notice things have changed on many levels :-). Let’s just say that it’s darn difficult to loose your data. And in my case here – I want to do exactly that. I want to completely clean my custom apps from the Docker container, including data.

By default, when you uninstall or unpublish the app, the data will not be removed. It will simply stay there in the companion tables or dedicated tables for the App – waiting for you to reinstall the app, or upgrade the app.

Why would I want to remove the data?

Well, just imagine development scenarios, where you are working on multiple apps (dependent or not) on one system, and you want to start from scratch again.

Or – in my case – when preparing for demos, and you want to – again – start from a clean sheet.

Or …

OK, show me how!

Well, as said, finally I made some time to put it into a function. And for your convenience, I already put it on my github, you can find it here.

And you see it’s simple. It assumes you’re already using the navcontainerhelper – which you should use when using NAV on Docker (in my opinion). More info on Freddy’s blog.

It is going to search for all apps which are not Microsoft’s apps, loop them, and uninstall, clean and unpublish all these apps one-by-one.. .

You can simply call this function like:

Clean-CustomNAVAppsOnDocker -ContainerName navserver

Are there other ways?

Well, you could obviously just ignore this entire blogpost, and simple replace the docker container by re-installing it. But in this case, you might lose data that you might depend on, or settings, or accessibility, or … .

If Docker still looks a little bit like this to you:

You might just want to reconsider re-installing the container, and just go for the function I talked about ;-).

 

 

 


Autonumber Objects in AL

$
0
0

I recently discovered what appears to be an undocumented feature in the current version of the al language extension (aka, the “Modern Dev”, aka DynDev365, aka ExtensionV2, aka VSCode Development Tools for Microsoft Dynamics NAV). And that is “Automatic Object Numbering”

On any objecttype, when enforcing intellisense, you get the lowest available number that was defined in the app.json.

Example

Consider this example, where I have this config in the app.json:

When creating some tables, it gives me the lowest available number in intellisense:

It’s just a matter of engaging intellisense at the right context..(CTRL+Space). It works obviously also when putting your objects in individual files.

Does it also work for fieldnumbers?

What ya think? Of course it does :-). Here is proof:

From which version is it available?

This is obviously part of the functionality of the VSCode extension, which is still under heavy development (although able to use for NAV2018 development though …). I’m personally using version 0.13.15836, which I think is the anniversary update:

Good stuff! Keep it comin’

Enable Code Analysis for AL

$
0
0

It’s the week of “undocumented features”, apparently. Today: code analysis. Apparently, the al-language extension comes with a built-in analysis for your al-code. Thing is: it’s disabled by default. Just go to settings (File/Preferences/Settings) and enabled it.

By adding the line to your settings.json of your environment (the right pane). Here is my settings.json-file:

You will get quite a number of “topics” it will analyse your code for. On the points it has issues with, it will show you a green line in your code, and you can see the exact “problem” as a tooltip when you hover over it, or in the “problems”-pane (CTRL+j / Problems). Here are just a few examples:

In this piece of code, I have 3 problems, which you can read below:

When hovering over the symbol with green line, you can see the problem. In this case, an unused variable:

What do you think of this one: you risk an overflow when you use this code:

Or one of my favorites: code that will never get executed:

Can I create my own analysis?

You can, but it’s a little bit cumbersome. You can create your own analysis-dll, drop it in the extension-folder, and go from there. I haven’t had a look at it .. because I’ll wait until this undocumented-but-already-cool-feature gets documented-and-even-cooler and supported, so we are sure that the work we put into it, is worth it. In the mean time: thumbs up, Microsoft!

Performance impact

I was told it does have a performance impact, so I guess that’s why it’s disabled by default. I haven’t noticed too much of an impact myself, to be honest.. but you are warned ;-).

CRS.RemoteNAVDockerHostHelper – my new PowerShell module

$
0
0

I have been struggling in getting my head around managing “stuff” on Docker. You know – the new kid in town that will see its use in many fields. We implemented a Docker-based environment for Build-server, for local dev, and now also for test servers for customers. And as you know – you can use is for much more!

Docker Host

In any case, you need docker “somewhere”. Some people install it on their Windows 10 – but that would be something I would never recommend, because in my opinion, it belongs on a “server”, simply because the memory management is much better and all that.. .

You are probably familiar with AJ’s blogpost on how to setup a nice local Docker Environment based on a Windows Core in a Hyper-V. I find it the ideal way to work with docker images locally, to be used for local development, testing, previewing, … you know .. a flexible and clean way to manage many different builds of Dynamics NAV.

navcontainerhelper

You are also quite familiar with the navcontainerhelper, probably. I absolutely love that PowerShell module that Freddy created. It basically solves the problem to call typical Dynamics NAV cmdlets remotely. When you look at the code (it’s all available on GitHub, by the way), it’s full of “Invoke-Command”, meaning that a function in the navcontainerhelper-module executes a number of NAV cmdlets remotely on the container. It’s much easier to work with, because you avoid having to enter the container session, and execute the cmdlets one-by-one.

So, what is this new module all about then?

Well, the downside of having a windows core docker host – or any “remote” docker host for that matter – is that you still have to enter remote sessions, and execute PowerShell from there. Just consider the following scenarios:

  • I have an AzureVM with NAV on Docker, and I just want to develop my apps on my own local machine. Occasionally, I’d like to do tasks like update the container on that machine, or publish an app, or test the upgrade code of my app, or.. . That’s powershell!  If you do this manually, it could mean that you need to:
    • Log into the AzureVM (remote desktop? Enter-PSSession?)
    • Copy the app and make it available on the remote machine, on a specific place I can access from the container as well
    • Use navcontainerhelper to do stuff in PowerShell
    • Or enter the container to do stuff straight into the container.
  • I have a VM running on my laptop.  In this VM, I have docker containers. Kind of like the setup that AJ suggests (and works great for me). I want to develop on my laptop, but publish on the container. Anything container or VM related, I would have to
    • Log into the AzureVM (RDP or Remote PS Session)
    • Copy the app and make it available on the remote machine, on a specific place I can access from the container as well
    • Use navcontainerhelper to do stuff
    • Or enter the container to do stuff straight into the container.

So, in both cases – you need to log into another machine. And all I want to do is repetitive tasks time and time again.

CRS.RemoteNAVDockerHostHelper

That’s where my new module comes into play. It’s definitely not a replacement of the navcontainerhelper – in the contrary – it’s dependent on it for some tasks. But it’s one step further, for the cases you are not working on the same machine as you have installed Docker – which appear to be the majority of the times, in my case.

Examples

I created two examples. Basically for me to be able to test the module .. But also to illustrate in what way you are able to use them. All scripts where I use the module, can be found on my github in this folder here: https://github.com/waldo1001/Cloud.Ready.Software.PowerShell/tree/master/PSScripts/NAV%20Docker/RemoteDocker

You see it contains a number of folders. Each folder represents a scenario. So, it contains scripts to be run against an AzureVM (where you enabled Remote PowerShell), and the other folder “waldocorevm” works against my local VM that contains docker.

Both folders contain a _Settings.ps1, which basically contains the connection details for that specific scenario. All the other scripts in the folder, work with these settings and with the CRS.RemoteNAVDockerHostHelper-module, to do what it’s entended for.

For example if you want to test to upgrade an app, just look at the UpgradeApp.ps1 and you’ll see it’s quite simple. No remoting, nothing, just calling a “simple” powershell function from the module, and all will be done for you in the background. Here is an example of the clean-script being executed from my laptop, but is going to remove all apps on a container of my VM on Azure:

I know, nothing much exciting, but if you know it is actually “remoting” into two sessions – well – quite cool, if I may say so myself ;-). This is the clean-function from the module:

One thing worth mentioning is that it’s also going to take care about your App-file that you have on your local machine, but you might want to publish way up there in the cloud.  Just look at the Copy-NAVAppToDockerHost, which is used by Install-NAVContainerAppOnDockerHost for example :-).  SImple, and efficient!

Where can I get this module?

Well, the easiest is to just download it from the PowerShell Gallery, by executing:

Install-Module CRS.RemoteNAVDockerHostHelper

But it is also available on my Github alongside my other modules: https://github.com/waldo1001/Cloud.Ready.Software.PowerShell

Feedback

Any feedback is useful! If you want me to address specific things, most convenient is to provide feedback on github. But on this blog is fine as well ;-). You are always welcome to fork into the project like many other already have done, by the way :-).

Remote PowerShell

If you would like to read up on remote powershell, well, there is a lot of info out there. Just a few examples which were useful for me:

 

CRS.RemoteNAVDockerHostHelper – Updated!

$
0
0

I’m not going to blog about each version of this module, but for this update, I felt obligated to share a few words. Primarily, because all has changed :-). Not one function is the same. I renamed all of the functions to a more convenient name – as they were quite long (not to say: ridiculous ;-)).

For that reason, I have edited my previous blogpost, where I introduced the new module. Still, since I (think I) made it a little bit easier for you to get started with it, let me share a few short paragraphs on the tool again (some is repeated, but you know – Repetitio Mater Studiorum Est ;-)).

Introduction

This tool has been created from my own development experience, where I have:

  • Machine 1: My Laptop or Home-PC where I develop. A “local development machine” if you will
  • Machine 2: A remote docker host, meaning either:
    • A VM on Azure, created by the wonderful templates for Freddy (like: aka.ms/navdeveloperpreview or aka.ms/getnav), where NAV is being made available through Docker.
    • A local VM on Hyper-V (on the laptop,, or on the PC), that has a Windows Core with Docker on it, where I want to run NAV Containers, same as it would be on the VM on Azure. This way of working is described by Arend-Jan Kauffmann here.
  • Machine 3: Docker Container running on that docker host, containing a NAV installation. These are the NAV ServerInstances I want to publish my apps to, and such .. basically the NAV I want to develop against..

So, it might be all on my laptop or partly on Azure – in any case, it’s 3 machines, which needs to be able to be managed likewise – by running PowerShell scripts remotely. And THAT’s the purpose of this module – to make that somewhat easier ;-).

Getting started

To get started with this module, there are two things you need to do first.

Enable Remote PowerShell on the Docker Host

You need to make sure that your docker host is remotely accessible by PowerShell. I’m not the expert in that, but what helped me was AJ’s blog and also this one to be able to set that up.

Install the dependent Modules

The module is dependent on some other modules, depending on the functionality you are going to use. Making these modules available is quite easy. I created a function for that, which is part of the module: Install-RDHDependentModules . Just run it like this, and all is set up:

Install-RDHDependentModules `
-DockerHost $DockerHost `
-DockerHostCredentials $DockerHostCredentials `
-DockerHostUseSSL:$DockerHostUseSSL `
-DockerHostSessionOption $DockerHostSessionOption `
-ContainerName $Containername

 

In a future version, I will probably include this in some other functions, just to prep the container if not already prepped.. .

You’re good to go!

So, when above is done, you’re good to go. For each remote environment, I tend to make a separate folder, like you see in here. Each folder holds a set of scripts, where one is the settings-file, with usually specific sessions for this docker host. This settings-script is usually ran first in any other script.. . It makes it easy: just figure out the remote execution settings once, and you’re good to go for all your specific scripts. Just take these folders as an example.

Also useful for upgrades?

You see a folder “UpgradesOnWaldoCoreVM” – this is now how I actually perform my upgrades – so yes, definitely useful. But how that works – that’s for a future blogpost – because I still need to clean it up a bit ;-).

Directions ASIA

$
0
0

Good things ahead. Like last year, I was given the opportunity to speak for Directions ASIA again. And not “just” for a few sessions – but I have quite some hours to cover (8.5 to be specific  ). More about that later. Let’s talk about the conference first.

Directions ASIA 2018

It’s the second time this conference is held by the “Directions EMEA” committee. And also this time, it’s in Bangkok, Thailand. I have been there last time, and you really can feel the enthusiasm and the positive vibe Dynamics causes – great feeling :-). So I’m definitely looking forward going back in a few weeks.

Who should Register?

It’s focused on NAV. So all people that are serious about Dynamics NAV, Dynamics 365, … Technical, business, sales, … should at least consider going. And obviously, for all the companies that are from that region (Bangkok – so that also means Australia and New Zealand), this is an ideal opportunity to get informed, directly from the right people!

Why should you join?

Well, it’s almost Spring, people. And you know what that means! We are almost at the release of the next version of Microsoft Dynamics NAV – and of the world wide release of Dynamics 365 codename “Tenerife” – so I’m expecting a lot of new information regarding the product we all love – the product that pays our salary ;-).

It’s basically also what Marko said in this video:

https://youtu.be/Dfw1BcYm9kY

All of the content is obviously already on the website – here is a shortcut: http://www.directionsasia.com/schedule/ . So – don’t ask why .. but ask “why not”. You won’t find an answer – so … register!

How can you register?

Just browse to http://www.directionsasia.com/, scroll down and click “Register Now” – easy peasy :-).

Will I “find waldo”?

This year is going to be especially busy for me. Because I’m going to deliver quite some content during the convention. It seems that I will be busy at almost all timeslots … so it’s going to be very hard for me to follow any of the new content.

On the first day – I have a “full day” (well, from after the key note, until the end of the day) workshop, called “Getting up to speed with Visual Studio Code and Extensions 2.0“. Ok, not a full day, only a 5,5-hour workshop ;-).

Next day, I have another 3 sessions to do:

C U All There!

Dynamics NAV and GDPR Compliance

$
0
0

 Disclaimer: this blog is mostly a repeat of what was in Microsoft’s blog .. I just try to spread the word

Sometimes I get the question: “Is Microsoft Dynamics NAV GDPR compliant”. I’m not a GDPR specialist, and don’t want to act like it. But …

This week, Microsoft blogged about GDPR. And it’s clear you need to ask yourself another question: How can Microsoft Dynamics NAV help YOU, to be GDPR compliant. Because it’s not about the software being compliant (obviously NAV is :p), but it’s about YOU being compliant. And we clearly have Microsoft Dynamics NAV on our side to help us!

What is GDPR?

You can find all information on GDPR here. GDPR stands for “General Data Protection Regulation” (Rules for the protection of personal data) and applies to all EU citizens and businesses – and – it’s due by May 2018 (meaning, you must make sure you’re compliant to it by that time)!

How does Microsoft help?

Microsoft is clearly dedicated to help us in this matter. In December last year, they released this blogpost which pointed you to the right information about GDPR.

This week, there was a follow up, that by May 2018, Microsoft Dynamics NAV 2018, 2017, 2016 and 2015 will be updated with tools to make you compliant! I assume that it has to do with the new “DataClassification” property on tables and fields, which is explained here.

The current available cumulative updates already have the first round of updates, which are explained in this whitepaper. I haven’t gone through the whitepaper myself yet .. I’m going to let that being processed by the people that actually understands it ;-).

Additional Information

Microsoft Dynamics 365 Business Central

$
0
0

Microsoft just released the new name for “Microsoft Dynamics 365 ‘Tenerife'”, where “Tenerife” was just a codename for the next version of “NAV-In-The-Cloud”. And as you might have figured from the title, that name is “Microsoft Dynamics 365 Business Central

You might know I’m totally not into “marketing fluff” or “branding” for that matter – so Iwouldn’t know if this is a good name. All I can say: I like it! I like it a lot!
;-).

The Blog

As said – Microsoft just announced today the new branding and some more – by means of a blogpost which you can and should read here. For your convenience, I also copied the content below this blogpost…

We have a date in 16 countries!

As already mentioned in earlier blogposts, we knew that “Tenerife” – sorry – Microsoft Dynamics 365 Business Central was going to be released in Spring. Well, now we know an exact date: April 2nd 2018! That’s less then a month from now, people!

And not only for the countries that already had Dynamics 365 available. No, now also for many others:

  • United States
  • Canada
  • United Kingdom
  • Denmark
  • Netherlands
  • Germany
  • Spain
  • Italy
  • France
  • Austria
  • Switzerland
  • Belgium (whoop whoop!)
  • Sweden
  • Finland
  • Australia (from July 1st, 2018)
  • New Zealand (from July 1st, 2018)

Want to learn more?

Microsoft has given two interesting links for you to learn more about:

So far for this small announcement. Please read the blog with the message here. Or here:

In the era of digital transformation, change is the new normal. From self-driving cars to quantum computing, a dramatic evolution is underway across industries. The most successful businesses are already reaping the rewards by expanding on flexible cloud platforms and meeting customer demands in real-time. Coupled by their new-found ability to collect comprehensive data, intelligently analyze results and respond with sophisticated automation software, they are now positioned as the disruptors in their given industries.

Later this spring, Microsoft will continue contributing to enabling digital transformation with new updates to Dynamics 365. This spring release will continue our focus on providing new modern, modular applications, expanded analytics & AI software and improvements to our global, trusted, hybrid and secure cloud platform.

Ahead of this spring release, I am thrilled to introduce Microsoft Dynamics 365 Business Central. Generally available beginning April 2nd, Business Central offers businesses a single, end to end solution for managing finances, operations, sales and customer service, and an opportunity to easily upgrade from entry-level accounting software and legacy ERP systems.

Business Central offers terrific value because it integrates with other Microsoft cloud services including Office 365 and can be customized or extended for specific industry needs with PowerApps, Microsoft Flow and Power BI. In addition, it also brings the full power and product maturity of Dynamics NAV to the cloud. As such, Business Central has at its foundation a set of trusted, proven technologies that have served 160,000 customers and millions of users worldwide. 

As a single, end-to-end application, Business Central offers:

  • Business without silos. Unify the business and boost efficiency with automated tasks and workflows—all integrated within familiar Office tools like Outlook, Word and Excel.
  • Actionable insights. Achieve greater outcomes and gain a complete view of your business with connected data, business analytics and guidance delivered by Microsoft’s leading intelligent technologies.
  • Solutions built to evolve. Start quickly, set the pace and adapt in real time with a flexible platform that makes it easy to extend Business Central based on changing business needs.

Dynamics 365 Business Central will be generally available on April 2, 2018, in 14 countries – United States, Canada, United Kingdom, Denmark, Netherlands, Germany, Spain, Italy, France, Austria, Switzerland, Belgium, Sweden, and Finland, purchased through our Cloud Solution Provider (CSP) partners. Australia and New Zealand will be generally available beginning July 1, 2018. Microsoft’s network of global partners has the expertise to help you create and deploy a solution that meets your industry-specific needs. Do even more with Dynamics 365 Business Central using pre-built applications, available through the AppSource marketplace, to easily and cost-effectively extend your solution.

Excited to learn more? Check out our Dynamics 365 Business Central website and explore our product capabilities on the Dynamics 365 Roadmap.

Source: <https://cloudblogs.microsoft.com/dynamics365/2018/03/13/announcing-microsoft-dynamics-365-business-central-greater-impact-with-an-end-to-end-view/>


Microsoft Dynamics 365 Business Central – some more info

$
0
0

My last blogpost was merely an announcement of Microsoft’s announcement about Microsoft Dynamics 365 Business Central. We are a 24 hours later now, so let’s share some more information about this new release of NAV-In-The-Cloud. I assembled this myself, from blogs, documents, slides, talks and mails – so there is a disclaimer for sure  (below the mail).

The name

With quite a sense of sarcasme .. we all “loved” the previous name, right? “Microsoft Dynamics 365 for Finance and Operation, Business Edition” – or short: MS365fFaOBE, or shorter MS365FOBE. The one that came up with that name .. well .. I want to try what he took that day ;-).

It was a bad name. I noticed because I had to explain time and time again the same things to the same people: no, it’s not only Finance, you can do more… .

In any case – glad we got rid of that! “Microsoft Dynamics 365 Business Central” is a strong name, all inclusive .. you nailed it!

Full NAV capabilities

Make no mistake. This release comes with the full NAV capabilities. Full? Yes? All? Yes! With Manufacturing? Yes!

As Microsoft puts it: “It is an all-in-one business management solution that helps organizations streamline business processes, improve customer interactions and enable growth“.

It even goes further, and Microsoft is clearly indicating three “pillars” (if I may call it like that):

  • Business without silos (:-)): basically being able to enhance/boost/connect your Dynamics 365 tenant by enabling workflows, or automated tasks by your familiar (Office) tools. I’m guessing Flow, Outlook, … . ;-).
  • Actionable insights: That’s data, right? Business Intelligence? PowerBI! Basically, connect again the familiar tools with your data to gain complete business insights – and even more, enabled with (and I quote) “Microsoft’s leading intelligent technologies”. Machine Learning comes to mind ;-).
  • Solutions built to evolve: the platform is NAV – which is simple, efficient and above all flexible! All you need to evolve beyond Business Central! I think with this pillar, Microsoft points to the great new Extensibility Model..

Two price points

There will be two price points: Essential and Premium. And I’m quoting Microsoft here again:

Essential includes:

  • Financial Management, including general ledger, workflows and audit trails, bank management, budgets, deferrals, bank reconciliation, dimensions, fixed assets, and currencies
  • Customer Relational Management, including contacts, campaigns, opportunity management, and built-in integration with Dynamics 365 for Sales
  • Supply Chain Management, including sales order management, basic receivables, purchase order management, locations, item transfers, and basic warehousing
  • Human Resources, including employees and management of their expenses
  • Project Management, including resources, estimates, jobs, and time sheets
  • Other, including multiple languages, reason codes, extended text, Intrastat reporting, scheduled tasks, and integration with Outlook

Premium includes following functionality, in addition to what’s offered in Essential:

  • Service Order Management, including service orders, service price management, service item management, service contract management, planning and dispatching
  • Manufacturing, including production orders, version management, agile manufacturing, basic supply planning, demand forecasting, capacity planning, machine centers, and finite loading, bringing the full breadth of the popular Dynamics NAV application to the cloud.

So, “Premium” is what I would call “the full monty” ;-).

When & Where?

Well, I already explained that in my previous blogpost, but let’s repeat. It will be available on April 2nd, 2018 in 14 countries – and in two more countries from July 1st:

  • United States
  • Canada
  • United Kingdom
  • Denmark
  • Netherlands
  • Germany
  • Spain
  • Italy
  • France
  • Austria
  • Switzerland
  • Belgium (whoop whoop!)
  • Sweden
  • Finland
  • Australia (from July 1st, 2018)
  • New Zealand (from July 1st, 2018)

Appsource

It’s Dynamics 365, so Customers will be able to install Apps from a store, called “AppSource”. They can even contact partnes (like me :)) to (and I quote) easily and cost effectively extend their solution to fit industry-specific needs. I’m not going to make any conclusions on that statement just yet…

How can you get ready?

Well, there are a number of webinars scheduled in the next months. But since this is all information for partners, I’m not sure I can share it here.  In any case – contact your local Microsoft contact soon to be part of all (or at least most) of these webinars!

Can you tell me more about the “functional” changes on the product?

Not that much yet – simply because I’m not completely informed. But let me share what I know.

The app will be available on all devices: Phone, Tablet, laptop, desktop .. All with the same rich functionality – not only on Windows, but also on Android and iOS.

Extended Outlook functionality brings you (and I quote): quote to cash, all within outlook. You can create quotes, based on the content of a mail .. And you can even submit invoices, all from Outlook!

There will be a stronger “intelligence” for forecasts, you will get better recommendations when to pay who, how to manage budgets, monitor progress, .. all with real-time data. Again, I’m thinking “Machine Learning” here…

An In-Client visual designer to support your “unique business needs”.

And, as mentioned above, you’ll be able to add apps from AppSource, again to fit your industry or business needs. And even, you will be able to create PowerApps based on all your data!

And don’t forget: there is going to be a refreshed UI which I really like. Let me share some screenshots:

The Role Center:

Customer List:

Just go to the capabilities page of Business Central, and you can watch some more screenshots there.

Is that all?

No, I have been able to gather some more information: answers to questions that people might have.

Is a Demo environment available?

It is mostly work in progress – but it will be at demos.microsoft.com. In the meantime, just use your demos.microsoft.com O365 account to sign up for a free Business Central trial – then those accounts are linked.

But the “decent” version will be available from April 2nd, when Business Central is generally available.

You will also be able to spin up your own docker image, and have a D365 docker image running on your own PC. Obviously, a lot will not work like that (like Office365 integration and such…) – but at least you will have the look and feel.

Will Dynamics 365 Business Central be available On Prem?

It is currently only a cloud based solution. Dynamics NAV 2018 continues to be available as is for on premises solutions, and being updated by means of cumulative updates, like we can see what is happening for  GDPR.

What about other countries?

I got that there is going to be news shortly. All I can say is: watch the roadmap here: https://roadmap.dynamics.com/ .. But be aware there are also opportunities for partner-led localizations on Business Central.

Are all features going to be available on prem release?

That is definitely the intent of Microsoft! They are still planning for one codebase.

Will there be any migration tools to Business Central?

Yes! There is already a conversion tool for QuickBooks. And more will come! There will even be transition tools for all of Microsoft’s current on prem SMB solutions, like GP and SL.

Will the name “NAV” disappear/change for On Prem?

Not that I know of.

Which modules of NAV are not part of Business Central?

That’s easy: None

Is Business Central again a merged name for NAV and AX based solutions?

Not that I know of. Business Central is the name of the online service, based on the NAV code base, previously referred to as “Tenerife”.

Will we lose the Windows Client in Q4, when the On Prem release is there?

The current plan of Microsoft is that we will NOT lose the Windows Client!

Disclaimer

All information above is my own interpretation of the news I have at hand at this point. I’m not responsible for any miscommunication or misinterpretation in any way… you know the drill…

AL with VSCode: IntelliSense Fix

$
0
0

Since a recent update of VSCode, you might have noticed that IntelliSense works somewhat different. Well, that’s because VSCode thought to do a good, useful update for you .. but apparently for AL development, it turns out to be quite contra productive..

CTRL+Space

You all probably know why CTRL+Space is for? It’s for forcing IntelliSense. Or the official term is “Trigger Suggest“. In a context-aware intellisense, it’s very useful to get suggestions on which keywords can be used in a certain context.

Since one of the latest updates of VSCode, the default behaviour has somewhat changed. When you “trigger suggest” (press CTRL+Space), it will point to the last one used.

Like in this example, I use the snippet “tprocedure”, and when I use the CTRL+Space to start coding, you will see it will jump straight to the “tprocedure”-item in the list, just because I just used it:

In a context-aware in IntelliSense, this just doesn’t make any sense.

You can fix this

VSCode wouldn’t be VSCode if you couldn’t fix this behaviour. And I have a strong feeling you would like to fix it ;-). It’s simple, just add following setting in your settings.json (File / Preferences / Settings):

As the tooltip explains: Editor.suggestSelection controls how the suggestions are pre-selected when showing the suggest list. In this case it will always select the first suggestion.

This means it will always suggest the first item in the IntellSense-list. Just the way you would expect (in my opinion). Let’s see what this means for our example:

Thanks Esben & Stan

When I was doing my session in Bangkok last week, Esben and Stan saw me struggling with this, and gave me the solution. :-). Thanks so much!

Enable the updated Code Analysis for AL

$
0
0

Some time ago, I wrote a blogpost on how to enable code analysis for AL development. At that point, it was an undocumented feature – not to say, it was an unfinished feature that you could already enable. Since the developer preview March update, it is officially here, and things have somewhat changed – no, not changed, improved! :-).

So, quite necessary to do an update on this, with a little more explanation than the documentation provides.

The documentation

Besides the explanation on the blogpost, there is also a section on docs: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-using-code-analysis-tool .

Please bookmark that, as that will probably contain the latest up-to-date information about this topic.

How to enable Code Analysis?

Well, there are now three VSCode Settings you need to take into account:

  • al.enableCodeAnalysis
  • al.codeAnalyzers
  • al.ruleSetPath

As you can see, you can do more as I previously talked about. From the settings, you can see we can enable code analysis, (duh…), we can even enable a certain analyzer (later more..), and even change some rules … . Hm, interesting! So in a way, (it seems) we can be quite specific on what we want to enable, and even change/add rules, if necessary. Let’s look into that!

Code Analyzers

So, the very basic setting would be setting the al.enableCodeAnalysis to true:

Well, this will enable all the analyzers by default.  To selectively select the analyzers (there are three as we speak), you can use the al.codeAnalyzers setting, like this:

There are three:

  • CodeCop is an analyzer that enforces the official AL Coding Guidelines.
  • PerTenantExtensionCop is an analyzer that enforces rules that must be respected by extensions meant to be installed for individual tenants.
  • AppSourceCop is an analyzer that enforces rules that must be respected by extensions meant to be published to Microsoft AppSource.

Wow! That is just amazing!

One remark though – when I was looking into this (and didn’t find any documentation – just because of my inability to search for stuff), Microsoft made the remark: “You should not have all three of them at the same time because that might give you conflicting diagnostics“. Well, I wasn’t able to run into any conflict – but I’d suggest you to play with it, like I am doing at this moment ;-).

Workspace settings

Personally, I think it makes a lot of sense to apply all this as “workspace settings”. Which basically means, my settings.json-file looks like this (depending on the analyzers you want to enable):

And is part of my workspace (it’s being saved in the .vscode-folder of the workspace).

Why I do this, well, I simply want to enable this not only for me, but for everyone that works on this project/workspace. So these settings need to end up in my source control, so that everyone’s source will be analyzed.

Bend the rules

It’s not only a matter of enabling the code analysis tool, you can also somewhat bend the rules. If you for example would like to change a “warning” into an “error” or vica versa .. well .. you can! Here is some more documentation on that:

Let me try to explain this with my own words, as I think you really want to do things like that. Let me give you two examples of warnings that the CodeCop analyzer gives you:

  • “You must specify open and close parenthesis after …”: let’s assume I don’t care about this one, and I want the code analyzer to skip this one for my workspace.
  • “Variable … is unused in the method …”: let’s assume I find this a really important one, and I don’t even want this in any compiled app! So this shouldn’t just be a warning, this needs to be an breaking error!

This is where we will apply rulesets!

Step 1: Find out which “DiagnosticId” the warning has.

Simple: press CTRL+SHIFT+B to build your app that has those errors, and you will see the Ids in the Output window. Here is an example:

Step 2: Create a ruleset file with the changed rules.

I make this file part of my project, and I want to put it in my own .codeAnalysis folder. Like in this case, I created a “thisproject.ruleset.json” which will contain the rules that I want to bend:

And this is how the ruleset would look like. Do know there are two snippets that help you with that “trule” and “truleset”.

Step 3: Point your setting al.ruleSetPath to your new ruleset-file.

Again, this is part of my workspace settings, which look like this now:

From this moment, you’re done. Just rebuild the project (CTRL+SHIFT+B) and here you go:

Which is the expected result! Errors for the unused variables, and the warning about the parenthesis is gone! And as a consequence, my app doesn’t build anymore! How.Cool.Is.That?

Include other rulesets

You can go further, like including company-rulesets and such, but I won’t bother you with that (just yet).

It basically comes down you can include rulesets by referring to the ruleset-file within your own ruleset, by using the “includedRuleSets” tag, and point to the path. Basically a way for you to give a structure, like creating different rulesets, and decide which one to include within your workpace-ruleset. Something like that …

List of all rules

I don’t have a list of all rules, and I haven’t found a way to get to the list (yet). But as soon as I do, I will post it here.

Enjoy!

Microsoft Dynamics 365 Business central – Resources

$
0
0

 Question.

Have you heard about something called “Microsoft Dynamics 365 Business Central”? If not, you must have been sleeping. Because it has been all over.  And it’s going to be released today!

Something new, also means new documentation. And I have been drowning in resources on Microsoft Dynamics 365 Business Central.

Allow me to try to sum up the different points

The Resources

So, let me share you some resources I was able to gather on Business Central, which I think are worth reading. Most probably, I will not list all resources, simply because I’m not aware of all. So, please feel free to add any forgotten resources in as a comment – I would be happy to add them to this post!

Videos

Videos are making it to the surface as well pretty fast. This filter gives you quite a nice overview on the Business Central videos on YouTube: https://www.youtube.com/channel/UCJGCg4rB3QSs8y_1FquelBQ/search?query=Dynamics+365+Business+Central, including these announcements:

Furthermore, I found these introduction videos:

Some videos regarding building Apps for Business Central (the more technical ones)

Dynamics Learning Portal

Last but not least, you should bookmark this page on the Dynamics Learning Portal, because multiple resources on Dynamics 365 Business Central will come available in spring 2018! There is already a 1-hour video on “How to Migrate Dynamics NAV C/AL Code to Visual Studio Code AL for Dynamics 365 Business Central” and a lot more to come!

There you have it! Happy listening, happy reading, … . I know that when you’re done reading this blogpost, it’s probably already outdated as many more resources on this new release is on its way!

Enjoy!

Al Code Analysis Rules (Diagnostic Descriptors)

$
0
0

Since my last blog about the new Code Analysis for Al development, I have been wondering what rules Microsoft actually applies in which Code Analyzer. My good friend an colleague is all into decompiling and reflecting – and he helped my find my way to the object model that Microsoft creates for the Source Code Analysis – to get to the “Diagnostic Descriptors”. We did that in PowerShell – of course  (I might share the code when it’s ready to  – it will end up on my PowerShell Repository eventually).

Below the result. As you know, there are 3 “cops” (Code Analyzers). Let’s see the result per Code Analyzer

AppSourceCop

IdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabled

ByDefault

AS0001Tables cannot be deleted.Tables cannot be deleted.Table ‘{0}’ has been deleted.UpgradeError

TRUE

AS0002Fields cannot be deleted.Fields cannot be deleted.Field ‘{0}’ has been deleted from table ‘{1}’.UpgradeError

TRUE

AS0003The previous version was not found.The previous version was not found.The previous version was not found. Name='{0}’, Publisher='{1}’, Version'{2}’UpgradeWarning

TRUE

AS0004Fields cannot change type.Fields cannot change type.Field ‘{0}’ has changed type from ‘{1}’ to ‘{2}’. Type changes are not allowed.UpgradeError

TRUE

AS0005Fields cannot change name.Fields cannot change name.Field ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0006Tables cannot change name.Tables cannot change name.Table ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0007Properties cannot change value.Properties cannot change value.The property ‘{0}’ has changed value. Value change is not allowed for this property.UpgradeError

TRUE

AS0008Keys cannot change name.Keys cannot change name.Key ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0009Key fields cannot be changed.Key fields cannot be changed.Key ‘{0}’ has changed the key fields. Changes to the field list are not allowed.UpgradeError

TRUE

AS0010Keys cannot be deleted.Keys cannot be deleted.Key ‘{0}’ has been deleted. Key deletions is not allowed.UpgradeError

TRUE

AS0011A prefix is requiredA prefix is requiredThe identifier ‘{0}’ must have the prefix ‘{1}’.ExtensibilityError

TRUE

AS0012A suffix is requiredA suffix is requiredThe identifier ‘{0}’ must have the suffix ‘{1}’.ExtensibilityError

TRUE

AS0013The field identifier must be within the allowed range.The field identifier must be within the allowed range.The field identifier ‘{0}’ is not valid. It must be within the allowed range ‘{1}’ – ‘{2}’ExtensibilityError

TRUE

AS0014The project manifest must contain the allocated identifier range.The project manifest must contain the allocated identifier range.The project manifest must contain the allocated identifier range.ExtensibilityError

TRUE

CodeCop

IdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabled

ByDefault

AA0001There must be exactly one space character on each side of a binary operator such as := + – AND OR =.There must be exactly one space character on each side of a binary operator such as := + – AND OR =. The parameter comma operator however, should have no spaces.There must be exactly one space character on each side of ‘{0}’.ReadabilityWarning

TRUE

AA0002There must be no space character.There must be no space character between a unary operator and its argument.There must be no space character after ‘{0}’.ReadabilityWarning

TRUE

AA0003There must be exactly one space character between the NOT operator and its argument.There must be exactly one space character between the NOT operator and its argument.There must be exactly one space character after ‘{0}’.ReadabilityWarning

TRUE

AA0005Only use BEGIN..END to enclose compound statements.Only use BEGIN..END to enclose compound statements.Only use BEGIN..END to enclose compound statements.ReadabilityWarning

TRUE

AA0008Function calls should have parenthesis even if they do not have any parameters.Use parenthesis in a function call even if the function does not have any parameters.You must specify open and close parenthesis after ‘{0}’.ReadabilityWarning

TRUE

AA0013When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.ReadabilityWarning

TRUE

AA0018The END, IF, REPEAT, FOR, WHILE, and CASE statement should always start a line.The END, IF, REPEAT, FOR, WHILE, and CASE statement should always start a line.The ‘{0}’ keyword should always start a line.ReadabilityWarning

TRUE

AA0021Variable declarations should be ordered by type.Variable declarations should be ordered by type. In general, object and complex variable types are listed first followed by simple variables.Variable declarations should be ordered by type.ReadabilityWarning

TRUE

AA0022Substitute the IF THEN ELSE structure with a CASE.An IF followed by two or more ELSE IF should be replaced with a CASE.Substitute the IF THEN ELSE structure with a CASE.ReadabilityWarning

TRUE

AA0074TextConst variable names should have an approved suffix.TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage.TextConst variable ‘{0}’ must have a suffix from this list: Msg, Tok, Err, Qst, Lbl, Txt.ReadabilityWarning

TRUE

AA0136Do not write code that will never be hit.Do not write code that will never be hit.Unreachable code detected.DesignWarning

TRUE

AA0137Do not declare variables that are unused.Do not declare variables that are unused.Variable ‘{0}’ is unused in the method ‘{1}’.DesignWarning

TRUE

AA0139Do not assign a text to a target with smaller size.Do not assign a text to a target with smaller size.Possible overflow assigning ‘{0}’ to ‘{1}’.DesignWarning

TRUE

AA0161Only use ASSERTERROR in Test Codeunits.Only use ASSERTERROR in Test Codeunits.Only use ASSERTERROR in Test Codeunits.DesignWarning

TRUE

AA0194Only write actions that have an effect.Remember to specify either the ‘OnAction’ trigger or ‘RunObject’ property on an action.Remember to specify either the ‘OnAction’ trigger or ‘RunObject’ property on an action.DesignWarning

TRUE

PerTenantExtensionCop

IdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabled

ByDefault

PTE0001Object ID must be in free range.Object ID must be in free range.{0} ‘{1}’ has an ID of [{2}]. It must be between 50000 and 50099.Object

Validation

Error

TRUE

PTE0002Field ID must be in free range.Field ID must be in free range.Field ‘{0}’ has an ID of [{1}]. It must be between 50000 and 50099.Object

Validation

Error

TRUE

PTE0003Functions must not subscribe to CompanyOpen events.Functions must not subscribe to CompanyOpen events.Function {0} subscribes to {1}.Object

Validation

Error

TRUE

PTE0004Table definitions must have a matching permission set.Table definitions must have a matching permission set.Table ‘{0}’ is missing a matching permission set.Object

Validation

Error

TRUE

PTE0005Property ‘target’ has invalid value.‘Internal’ is a reserved usage for the ‘target’ property.App.json ‘target’ property must not be set to ‘Internal’.Package

Validation

Error

TRUE

PTE0006Encryption key functions must not be invoked.Encryption key functions must not be invoked.Encryption key function ‘{0}’ is not allowed. Package

Validation

Error

TRUE

PTE0007Test assertion functions are not allowed in a non-test context.Test assertion functions are not allowed in a non-test context.Assertion function ‘{0}’ must not be invoked.Package

Validation

Error

TRUE

PTE0008Fields must use ApplicationArea property.Fields must use ApplicationArea property.Field with name ‘{0}’ must have a value for the ApplicationArea property.Package

Validation

Error

TRUE

Enjoy!

CRS Al Language Extension

$
0
0

I have been wanting to write this blog for a while. But I’m going to keep it a short one, as I’d like to go into a few topics separately, and I don’t want to swallow too much in one big blogpost with the possibility with some (important?) details would get lost.

Thing is – I wrote an Extension. And I’m not talking about an Extension for Business Central in VSCode. No. Well – I did write a few of those as well, but that’s not what this blog is about. I made a VSCode Extension…

VSCode Extensibility

One of the major advantages and key strengths of VSCode as a development editor is its extensibility model: if you are missing a feature, you might want to search in the marketplace to see if someone already added a feature, download it, and there you go, you extended your editor with new capabilities.

PowerShell is a nice example: you want to do PowerShell with VSCode. It’s not there out-of-the-box. But if you just search for an Extension for PowerShell, download it, and there you go, in 1 minute, you’re ready to develop PowerShell in VSCode.

At this point, there are about 6241 VSCode Extensions on the marketplace – and one of them is the CRS Al Language Extension: a VSCode Extension, to add some new features that I was missing for Al Development. So, let me go over the current contributions… .

Contributions

When you’re talking about “things you added” in a VSCode Extension, you are actually talking about “contributions”. It can be a number of things, like new commands, new settings, new snippets, Keyboard bindings, Colorizers, debuggers, … . And I have been fumbling with some of these things to get some new features to us, Al developers.. . As said, I will only sum up the different contributions with a short description – and if necessary, I might come back to them in later blogposts.. .

Running Objects

I added some commands to the command palette to run an object in either web, phone, tablet or windows client. It’s also possible to run the current object by pressing CTRL+SHIFT+R.

Rename and Reorganize Files

In order to make it easy on you to not bother about file names, I created some commands to manage the filenames for your by renaming them, and even reorganizing them in a folder. It makes it easy for you to be aligned with the naming convention of Microsoft– or you can even set up your own filename convention by customizing the file name pattern in the settings.

Page Wizard Snippet

I give a lot of trainings all over the world – and I always see people struggling and losing time when creating wizard pages – one of the ways to SaaSify your solutions. I included a snippet ‘tpagewizard’ to start with, which drastically lower the time you spend on wizard-pages.

Snippets for Permissions and Web Services

To make it easier for developers to include permission sets and (publishing) web services in their app – for which xml-files need to be created – I simply included some xml-snippets that you can use. Just create an xml-file, and use the snippets to define permission sets and/or web services.

Snippet Management

The snippets that Microsoft published are great! But – in my modest opinion – not perfect. So what I did, I created a setting to be able to disable Microsoft’s snippets. On top of that, I included my own “improved” set of snippets. You are able to enable/disable both my crs-snippets as Microsoft’s snippets and have it exactly the way you want!

How can I get the “CRS Al Language Extension” in my VSCode?

The easiest way is to just search and download it from within VSCode. Go to the Extensions, search for “CRS Al Language Extension”, it will find it, download it, enjoy!

Up-to-date Information & Feedback

I will not blog about every little change on this extension. But I’d like to share a few links that I think are useful – both for getting information as well as for giving feedback about the extension.

From the marketplace, you can find all available extensions for VSCode, so that means you can also find the CRS Al Language Extension. On that page, you can see

  • a description of the extension – that’s a readme file that is part of the extension, and will shortly explain the different contributions that I put into the extension. I intend to maintain this file, and describe all new/changed features.
  • A changelog, which is also a file that is part of the extension. I always update it for each version I publish with the changes that are included in what version.
  • A link to the repository, which is github. There, you find the code. If you want to build your own VSCode Extension – look at it, and you might find some useful code to start with. No license – you can copy whatever you like (or don’t like).
  • A link to the open issues. This is the stuff I’m working on, which are tagged and put into milestones. If you have any type of feedback, you are more than welcome to create a new issue on that page, and explain what it is: what is not working, or what feature you would like me to look into, or anything else regarding this VSCode Extension. Any feedback is always greatly appreciated!

How much does it cost?

The tool is under the umbrella of Cloud Ready Software, and is free of charge, without any strings attached, nor any intention for any upselling or whatever (nor with any guarantees, by the way ;-)). It’s our way to give back to the community we like so much. We just hope you enjoy it!

Function Overloading in AL

$
0
0

I haven’t been blogging much, lately. But in my defence – I put quite some time in another community project, which I blogged about in my previous post (and will blog about in quite a few coming posts…). To keep up the pace of writing at least one post each month (which I have been able to do so for the past 11 years or so) – I HAD to put something up urgently ;-). And it’s going to be about a new possibility we have in the AL language, which is often forgotten:

Function Overloading

In C/AL we never had the ability for overloading a function. You know: using the same function name with a different context (parameters).

Now – YES WE CAN! It’s all pretty well described on docs:

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-overload-method

How cool is that?

Can I overload more?

Overloading my own functions is nice. But the question I always get in my classes is: can we also overload functions from the default app – or from any dependent app for that matter.

Well – in short: YES WE CAN!

Let me give you a simple example:

I’m overloading the default method “CreateAndShowNewInvoice” on the vendor table with a different context (Text-parameter). So I have a completely new method, with the same name.

One thing that would be interesting is to be able to extend on a main method like that – and that’s what I basically doing above – I call the main method, and extend it with my own code.
Dependencies

As this works on the default app, you can expect it does work on dependent extensions as well. I created an example on my github, which you can look into.

Extension A implements a new method on the Item table (or should I say “class” ;-)):

Extension B has a dependency on A, and implements a slightly different implementation of that method. You see: same function name, different parameters

To Test the overload, I created a subscriber to logInManagement .. And you’ll see that B basically extended the implementation of A…

And yes, I hear you – One should test with a test-codeunit. So I created that for you as well :-).

And if you’re using the CRS AL Language Extension, it’s easy. Just run the C/AL Test Tool from VSCode from the command palette:

And there you go!

Enjoy!


CRS Al Language Extension – Running Objects

$
0
0

As said in one of my previous posts, I was going to do some “deeper” description of the functionality of the tool that I’m working on to make your “AL”-life in VSCODE a little bit easier: the “CRS AL Language Extension“.

Today: the “Running Objects” functionality

This was the first major feature that I tried to add. Namely, being able to run an object without having to change and save the launch.json. The easiest way to find the functionality is in the Command Palette. Just search for “>crs:run”, and it will give you all options:

Run Object in Web/Phone/Tablet Client

These options will run an object, using the web client either in web, phone or tablet mode .. without having to update the launch.json all the time.. . The functionality is going to look at your launch.json-file to figure out where you are deploying – and it will use those settings to run an object. So you actually don’t have to do anything to make it work – just have a valid server set up in your launch.json.

However, I was notified that it doesn’t work in all cases – so I also built an option for you to use a “PublicWebBaseUrl“. So, if necessary, just set that up in your settings (makes sense to use a workspace-setting for that). Use the same value as what would be in your serverinstancesettings .. and you should be good to go!

Run Current Object (Web Client)

This is (in my opinion) the coolest one – at least one that I use a lot, also because there is a shortcut that I created for that: CTRL+SHIFT+R (CTRL+R was already taken…). Just when you have an active file open, it will figure out what object that is (I have a NAVObject class that can do that…) – or what object your are extending – and run that object in the web client.

Run CAL Test Tool in Web Client

This is also a variation on the above – it’s basically just running a fixed page.. . But very useful when you are building test-codeunits. Since I’m trying to implement Test-Driven-Development, usually you run the testsuite a lot while implementing your business logic. So personally I’m running this quite a lot ;-).

Run Object In Windows Client

You might have noticed – there is also a command to run an object in the windows client. The nice thing about the windows client is that it can run any type of object– while in the web client, you can only run a table, report or page. The downside is that it doesn’t really work very well with Docker, since it assumes you have a windows installation, and will use the “DynamicsNAV:///”-URL to start the specific object. Let’s say it’s work in progress to have this decently running on docker ;-).

But IF you have all in place, you just need to make sure to set up the connection to it as well with these settings:

  • CRS.WinServer: Server where the windows client is connecting to
  • CRS.WinServerInstance: Serverinstance where the windows client is connecting to
  • CRS.WinServerInstancePort:Portnumber of the serverinstance where the windows client is connecting to

Feedback

Feedback is always appreciated! If you can make this work on a Docker image – plase share ;-). If you have other pages that might be interesting to add as a separate command – share! Any other feedback – share! :-). The best place to share feedback, bugs, .. anything, is the issues-page on my github for this project, which is here: https://github.com/CloudReadySoftware/crs-al-language-extension/issues

Enjoy!

Are you “Ready To Go”?

$
0
0

Lately I have been involved in a program from Microsoft that I personally think is really useful. That useful that I’m spending my only spare time at a pool (and not in it) in Bangkok to tell you about it.

The Ready To Go Program

If you are a partner for Dynamics NAV, you must have heard about Microsoft Dynamics 365 Business Central by now. Whether you like it or not (and I do…), it is a major shift in about everything that has to do in the area we have been doing it. And you might wonder on how to make that shift with your company – which can be seen as a serious challenge. Not because it’s hard to do – just because there are so much more new possibilities on top of what we have been doing for so long.. . All of a sudden there is something called “AppSource” – what to do with that? How to get there? What is it FCOL?

Well – don’t worry – Microsoft is here to help you – by initiating the “Ready To Go” program. One that in my opinion, every partner should at least be aware of (therefore this blogpost ;-)). My company have been involved in this program quite heavily – it has taken a lot of time, travels, preparation, coaching, recordings, … and still does. But that also makes me so proud of it, because we are starting to see the result! (yet another reason of this blog …).

What is it?

The “Ready To Go” Program is designed to support you in bringing your Microsoft Dynamics 365 Business Central offers into Microsoft Appsource. And it does that with these three components:

  • The “Ready To Go” online learning– there is a huge amount of hours of content online (mainly the Dynamics Leaning Portal), all at your disposal! Not only for developers, but also for marketeers, business decision makers, (pre)sales, architects and consultants.  An overview of the materials can be found in this pdf document.
  • The “Ready To Go” coaching– an initiative from the ISV Development Centers together with Microsoft, to coach wherever needed. For example I have been involved in loads of trainings in quite some countries (Today I’m in Bangkok for my next training, and I just arrived here from Dubai, where I did my previous one – while Daniel is in Hongkong, and will do Manilla after that). But we also do online coaching by evaluating your product, and guide you into the next steps forward. The ISV Development Centers are:

    I included the link for all of them! We have all the same kind of offering for the same price, when it comes down to coaching you to AppSource. Because we all believe in the cause: getting you to the cloud is much more important that starting to compete in the service to do that.

  • The “Ready To Go” platform– There is a platform to support you in all you need – where most importantly: the necessary dev-environments for Business Central. Not only the current, upcoming and daily builds – but also a feedback platform to the engineers working on Microsoft Dynamics 365 Business Central. All you need to do is getting yourself registered on “Microsoft Collaborate” and off you go!

More information

Now, the above is actually a summary of what you can find here on Microsoft Docs. I would advice to carefully read through it, and start making sure you are “Ready To Go” as well! Good Luck!

AL Code Analysis Rules (Diagnostic Descriptors) – Updated

$
0
0

 

You might remember my post about the Code Analyzers Diagnostic Descriptors when it first came out. I’m very happy with this tool, as it avoids many mistakes, and it enforces some level of clean coding – which is never a bad thing ;-).

Recently, the June update of the AL Language Extension was announced. I was sitting at a swimming pool in Bangkok – so what do you think I did? Exactly:

It turned out I downloaded the wrong one :-). I needed to download from the daily build “bcinsider.azurecr.io/bcsandbox-master”.

Anyway, when playing with it, I noticed there was an update on the analyzers as well – so it seemed interesting to update my previous blog in the descriptors, and let’s see what we have now. There are new descriptors, fixed descriptors, and even a whole new CodeCop, the UICop!

AppSourceCop:

This is the one that is use for extensions that will be used on AppSource – and on this one, nothing has changed.

DiagnosticIdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabledByDefault
AS0001Tables cannot be deleted.Tables cannot be deleted.Table ‘{0}’ has been deleted.UpgradeError

TRUE

AS0002Fields cannot be deleted.Fields cannot be deleted.Field ‘{0}’ has been deleted from table ‘{1}’.UpgradeError

TRUE

AS0003The previous version was not found.The previous version was not found.The previous version was not found. Name='{0}’, Publisher='{1}’, Version'{2}’UpgradeWarning

TRUE

AS0004Fields cannot change type.Fields cannot change type.Field ‘{0}’ has changed type from ‘{1}’ to ‘{2}’. Type changes are not allowed.UpgradeError

TRUE

AS0005Fields cannot change name.Fields cannot change name.Field ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0006Tables cannot change name.Tables cannot change name.Table ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0007Properties cannot change value.Properties cannot change value.The property ‘{0}’ has changed value. Value change is not allowed for this property.UpgradeError

TRUE

AS0008Keys cannot change name.Keys cannot change name.Key ‘{0}’ has changed name to ‘{1}’. Name changes are not allowed.UpgradeError

TRUE

AS0009Key fields cannot be changed.Key fields cannot be changed.Key ‘{0}’ has changed the key fields. Changes to the field list are not allowed.UpgradeError

TRUE

AS0010Keys cannot be deleted.Keys cannot be deleted.Key ‘{0}’ has been deleted. Key deletions is not allowed.UpgradeError

TRUE

AS0011A prefix is requiredA prefix is requiredThe identifier ‘{0}’ must have the prefix ‘{1}’.ExtensibilityError

TRUE

AS0012A suffix is requiredA suffix is requiredThe identifier ‘{0}’ must have the suffix ‘{1}’.ExtensibilityError

TRUE

AS0013The field identifier must be within the allowed range.The field identifier must be within the allowed range.The field identifier ‘{0}’ is not valid. It must be within the allowed range ‘{1}’ – ‘{2}’ExtensibilityError

TRUE

AS0014The project manifest must contain the allocated identifier range.The project manifest must contain the allocated identifier range.The project manifest must contain the allocated identifier range.ExtensibilityError

TRUE

CodeCop:

The CodeCop is the one you should always align with. It’s the one that basically has general descriptors – which are always interesting. And in this one, we have two more “rules” we have to take into account – I put them in yellow. Both are quite logical, but now at least you have descriptors/rules/analysers that prevent you from doing things like that ;-).

DiagnosticIdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabledByDefault
AA0001There must be exactly one space character on each side of a binary operator such as := + – AND OR =.There must be exactly one space character on each side of a binary operator such as := + – AND OR =. The parameter comma operator however, should have no spaces.There must be exactly one space character on each side of ‘{0}’.ReadabilityWarning

TRUE

AA0002There must be no space character.There must be no space character between a unary operator and its argument.There must be no space character after ‘{0}’.ReadabilityWarning

TRUE

AA0003There must be exactly one space character between the NOT operator and its argument.There must be exactly one space character between the NOT operator and its argument.There must be exactly one space character after ‘{0}’.ReadabilityWarning

TRUE

AA0005Only use BEGIN..END to enclose compound statements.Only use BEGIN..END to enclose compound statements.Only use BEGIN..END to enclose compound statements.ReadabilityWarning

TRUE

AA0008Function calls should have parenthesis even if they do not have any parameters.Use parenthesis in a function call even if the function does not have any parameters.You must specify open and close parenthesis after ‘{0}’.ReadabilityWarning

TRUE

AA0013When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character.ReadabilityWarning

TRUE

AA0018The END, IF, REPEAT, FOR, WHILE, and CASE statement should always start a line.The END, IF, REPEAT, FOR, WHILE, and CASE statement should always start a line.The ‘{0}’ keyword should always start a line.ReadabilityWarning

TRUE

AA0021Variable declarations should be ordered by type.Variable declarations should be ordered by type. In general, object and complex variable types are listed first followed by simple variables.Variable declarations should be ordered by type.ReadabilityWarning

TRUE

AA0022Substitute the IF THEN ELSE structure with a CASE.An IF followed by two or more ELSE IF should be replaced with a CASE.Substitute the IF THEN ELSE structure with a CASE.ReadabilityWarning

TRUE

AA0040Avoid using nested WITH statementsWITH statements should not be nestedAvoid using nested WITH statementsReadabilityWarning

TRUE

AA0074TextConst variable names should have an approved suffix.TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage.TextConst variable ‘{0}’ must have a suffix from this list: Msg, Tok, Err, Qst, Lbl, Txt.ReadabilityWarning

TRUE

AA0100Do not have identifiers with quotes in the name.Do not have identifiers with quotes in the name.Do not have identifiers with quotes in the name.DesignWarning

TRUE

AA0136Do not write code that will never be hit.Do not write code that will never be hit.Unreachable code detected.DesignWarning

TRUE

AA0137Do not declare variables that are unused.Do not declare variables that are unused.Variable ‘{0}’ is unused in the method ‘{1}’.DesignWarning

TRUE

AA0139Do not assign a text to a target with smaller size.Do not assign a text to a target with smaller size.Possible overflow assigning ‘{0}’ to ‘{1}’.DesignWarning

TRUE

AA0161Only use ASSERTERROR in Test Codeunits.Only use ASSERTERROR in Test Codeunits.Only use ASSERTERROR in Test Codeunits.DesignWarning

TRUE

AA0194Only write actions that have an effect.Remember to specify either the ‘OnAction’ trigger or ‘RunObject’ property on an action.Remember to specify either the ‘OnAction’ trigger or ‘RunObject’ property on an action.DesignWarning

TRUE

PerTenantExtensionCop:

When you are doing customer development for a customer on the Business Central cloud, you are actually doing a “Per Tenant Customization”. The PerTenantExtensionsCop contains the rules to comply with. Nothing new, but there are a few fixes, as in the previous version, there was a hardcoded range of 50000..50099 in the first two descriptors.. .

DiagnosticIdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabledByDefault
PTE0001Object ID must be in free range.Object ID must be in free range.{0} ‘{1}’ has an ID of [{2}]. It must be between {3} and {4}.ObjectValidationError

TRUE

PTE0002Field ID must be in free range.Field ID must be in free range.Field ‘{0}’ has an ID of [{1}]. It must be between {2} and {3}.ObjectValidationError

TRUE

PTE0003Functions must not subscribe to CompanyOpen events.Functions must not subscribe to CompanyOpen events.Function {0} subscribes to {1}.ObjectValidationError

TRUE

PTE0004Table definitions must have a matching permission set.Table definitions must have a matching permission set.Table ‘{0}’ is missing a matching permission set.ObjectValidationError

TRUE

PTE0005Property ‘target’ has invalid value.‘Internal’ is a reserved usage for the ‘target’ property.App.json ‘target’ property must not be set to ‘Internal’.PackageValidationError

TRUE

PTE0006Encryption key functions must not be invoked.Encryption key functions must not be invoked.Encryption key function ‘{0}’ is not allowed. PackageValidationError

TRUE

PTE0007Test assertion functions are not allowed in a non-test context.Test assertion functions are not allowed in a non-test context.Assertion function ‘{0}’ must not be invoked.PackageValidationError

TRUE

PTE0008Fields must use ApplicationArea property.Fields must use ApplicationArea property.Field with name ‘{0}’ must have a value for the ApplicationArea property.PackageValidationError

TRUE

UICop:

This is the new one! A whole new analyzer for you to use to be able to comply with the Web Client.

DiagnosticIdTitleDescriptionMessageFormatCategoryDefault SeveretyIsEnabledByDefault
AW0001The Web client does not support displaying the Request page of XMLPorts.The Web client does not support displaying the Request page of XMLPorts.The Web client does not support displaying the Request page of the XMLPort ‘{0}’.WebClientWarning

TRUE

AW0002The Web client does not support displaying both Actions and Fields in Cue Groups. Only Fields will be displayed.The Web client does not support displaying both Actions and Fields in Cue Groups. Only Fields will be displayed.The Web client does not support displaying both Actions and Fields in the Cue Group ‘{0}’. Only Fields will be displayed.WebClientWarning

TRUE

AW0003The Web client does not support displaying Repeater controls containing Parts.The Web client does not support displaying Repeater controls containing Parts.The Web client does not support displaying Repeater controls containing Parts.WebClientWarning

TRUE

AW0004A Blob cannot be used as a source expression for a page field.A Blob cannot be used as a source expression for a page field.A Blob cannot be used as a source expression for a page field.WebClientWarning

TRUE

Now you know!

Enjoy!

CRS AL Language Extension – File Management

$
0
0

Time for the next round of functionality I added in my VSCode Extension (the CRS AL Language Extension) – a functionality that manages your filenames (and pre/suffix). Hold your horses – this is going to be a long one ;-). You don’t want to know how many hours I spent on this functionality – many points of feedback from the community, and even some pullrequests from some (for all of which I’m very thankful!) has made it into the functionality it is today.

The problem(s) I wanted to solve

There are multiple problems with filenames, to be honest.

We never cared about this

In a way, we are not used to deal with filenames, because in C/AL, we simply have an object designer – which only needs an object name. So, this is new!

There is a “File name convention”

On top of that, there is even a file name convention that Microsoft wants us to follow. You can find them here on Docs. When you read carefully through it, you’ll see that it gives some practical challenges:

  • Every name has the object ID
    • I don’t know that object ID when I create the file?
    • But I need to create the file first to give it the al-extension, to put the client in language mode “al”
    • What if I renumber my object – then I need to think about renaming the file as well!
  • Every name has also the object name – what if I rename my object -then I need to think about renaming the file as well!
And what about subfolders?

Next to that, it is not a good practice to have our files all in the root – so we should be putting that into subfolders. Microsoft’s recommendation is to have:

  • \Src – for source code
  • \Res – for resources (whatever that means – control addins?)
  • \Text – for testability

And within these subfolders, you can create a next level of subfolders. I would recommend subfolders that indicate a certain functionality. Many people create subfolders by object type – but why would one do that? Because C/SIDE did that? It’s much more convenient that you create a structure based on functionality, so that all objects (reports, tables, pages, … ) that belong together, are actually together. Like this example:

  • \Src
    • \_FunctionLibrary
    • \NotificationMgt
    • \InterCompany
    • \Sales
  • \Test
    • \NotificationMgt
    • \InterCompany
    • \Sales

You see – you can even follow the same structure in your testability – although there is a lot to say about that (it might be better to do testability in a separate app – it gives you much more flexibility by decoupling/disabling your methods if necessary – but that’s a whole other topic).

And even prefixes

And then there is prefixes. Know that there is a requirement for apps on AppSource – they need to be prefixed! Not only objects, but also fields and controls that you add to existing tables/pages! Simply because of the fact that one field or control can’t be added twice ;-).

Also, you need to make sure your prefix is unique. And to do that, there is a mail address to apply for a prefix: d365val@microsoft.com.

I don’t want to care about this

It adds complexity to my project, and it needs to add discipline to the developers. Complexity and discipline, that’s a dangerous combination to rely on. So I don’t want to.

 

That’s why I started to build something that can manage this for me.

Rename/Reorganize

Maybe first some vocabulary:

  • Rename = Renaming a file following a pattern (which you can configure – the default is the one Microsoft describes).
  • Reorganize = Renaming a file, and put it in a subfolder (categorized by object type).

Renaming is very interesting. Reorganizing – to be honest – I don’t use that anymore, because as said before, I believe you should organize your objects per functionality, not per object type. This was just something we were used to from the Object Designer. But now we can do better ;-).

To start with, I added commands to the command palette:

One downside on a command is that you have to manually run this. So every single time you create, renumber, rename, .. an object, you need to think about running one of these as well …

I’m lazy and undisciplined, so this was not automatic enough. So I included a setting that this can be done automatically “OnSaveFile”. But later more about that – let’s first talk about the basic settings…

The Basic Settings

There are quite some settings – but do know you don’t *need* to set up anything – it will just work without settings, as the defaults are the ones that Microsoft describes. Let me try to categorize them a bit:

SettingDefaultOptions
CRS.FileNamePattern<ObjectTypeShort><ObjectId>.<ObjectNameShort>.al<Prefix>

<Suffix>

<ObjectType>

<ObjectTypeShort>

<ObjectId>

<ObjectName>

<ObjectNameShort>

<ObjectTypeShortUpper>

CRS.FileNamePatternExtensions<ObjectTypeShort><BaseId>-Ext<ObjectId>.<ObjectNameShort>.al<Prefix>

<Suffix>

<ObjectType>

<ObjectTypeShort>

<ObjectId>

<ObjectName>

<ObjectNameShort>

<ObjectTypeShortUpper>

<BaseName>

<BaseNameShort>

<BaseId>

CRS.FileNamePatternPageCustomizations<ObjectTypeShort><BaseId>-PageCust.<ObjectNameShort>.al<Prefix>

<Suffix>

<ObjectType>

<ObjectTypeShort>

<ObjectName>

<ObjectNameShort>

<ObjectTypeShortUpper>

<BaseName>

<BaseNameShort>

<BaseId>

CRS.AlSubFolderNameSrc“Src”

“Source”

“Objects”

“Al”

“None”

Since a normal file, and extension file and a customization all have a different pattern, I needed to split it in three settings. You can change them at your convenience using the tags you see in the third column.

Some tips that go along these settings

Before you start renaming your files – commit your code to Git first, because that will be the only rollback you will be able to do ;-).

The last setting “AlSubFolderName” is only used to reorganize the file(s). If you don’t ever want to accidentally run that command, just set it up with “None” – that will deactivate the “reorganize” command, and prevent from accidentally disrupting your (manual) folder structure. This is what I do lately.

Automatically rename/reorganize filenames (when you save a file)

As I said, I don’t like to manually run any command, because that demands me being disciplined. I’d like to rely on the opposite, so I also introduced another setting “CRS.OnSaveAlFileAction”:

Default setting is “DoNothing”, but you can set it to “Rename” or “Reorganize” which will simply call the Rename/Reorganize Current File when you save a file.

Tips:

I usually set this on workspace-level, so that I always have a decent filename in my repository, whoever is working on my app.

If you apply your own folder structure, set this setting to “rename” – else your folder structure is going to get automatically messed up ;-).

Prefix/Suffix

It is a good practice to prefix as well, to avoid conflicting names in objects, fields, … a requirement which Microsoft describes here. And it’s best to apply for a prefix by mailing to d365val@microsoft.com– just to make sure your prefix is reserved and unique.

I built that into the “Rename” and “Reorganize” feature mentioned above. So when you try to rename/reorganize a file, it’s also going to check whether you set up a prefix/suffix, and it’s going to apply that to the :

  • Object Name
  • Actions (only prefix)
  • Fields (only prefix)

There are a few settings that make that possible:

  • CRS.ObjectNamePrefix
  • CRS.RemovePrefixFromFilename
  • CRS.ObjectNameSuffix
  • CRS.RemoveSuffixFromFilename

As you can see, there are some “Remove” settings as well. They are there to avoid to have the prefix in the filename (as the filename will get the object name by default). This will give you much nicer filenames without prefixes.

Tips:

By default, the system is not going to prefix/suffix anything. You will have to set these settings before anything will be prefixed

Because of the “OnSaveAlFileAction” setting, the prefixes will be applied automatically as well – no extra work needed.

Warning:

If you renumber/reorganize for the first time with a prefix – it’s not actually going to “rename symbols”, which means you will end up with compile errors. They are easy to solve, so don’t panic! – it’s just not possible (yet) to do a decent rename symbol with the VSCode API to prevent this.

That’s it!

That’s all, folks. This has cost quite some hours of my life – and not only my life, also from a few people from the community, that has contributed to the project on github, like Dmitry Katson and Johannes Wikman. I so love this community :-).

Things that need improvement

That doesn’t mean that things doesn’t need improvement. While writing this blog, i realized that I actually never implemented the suffix for fields and actions. Probably because I never needed it – because we always “prefix” our objects.

In any case – if there is anything you lack, might want to have changed – don’t hesitate to file an issue on my repository.

My Settings

Let me conclude with my settings – what I usually use (in terms of this blogpost, obviously). Well, here is an example:

I usually don’t use the “Reorganize”, as I want to organize my files manually in function areas (subfolders). So the “AlSubFolderName” is “None”, which prevents anything to reorganize (it basically disables that function).

I do want to rename everything automatically, therefore the “OnSaveAlFileAction” to “Rename”.

And then I set a prefix, since that’s mandatory by Microsoft. It’s best to have this prefix set all in the beginning. So make sure you apply for a prefix rather sooner than later!

Developing Business Central Extensions/Apps in Team

$
0
0

I picked up a new challenge these days: for one of our (quite big) customers, we need to develop a solution, based on extensions. In short: ready for the future, easy to upgrade. When I would explain the case in a paragraph, you’d say “this is not NAV”, although when you would really look deep into it, it’s ideal for an Extension-scenario, obviously in combination with Business Central.

The project

In short, let’s define the project like this:

  • Multiple extensions to be made:
    • A W1 Base Extensions with shared functionality and frameworks
    • For each country (like Belgium) a separate extension, specifically for local functionality
  • The timespan is 2 years
  • We are working with 5 developers at the same time on this project, spread over 3 countries. Good developers, which means not really infrastructural-minded.
  • Test Driven development in an agile approach

So, one project, multiple extensions, multiple developers spread over multiple countries (not time zones, luckily), dependencies, different symbols (W1 and BE), … .

Why this blogpost?

Well, we came to the conclusion that “developing an extension” is one thing. One app, usually one developer, some local development environment, it’s all very manageable. But when you try to do development in team– it’s a whole different story. And we have faced (and still facing) quite some points that need attention. You will see this is a train of thoughts – not a complete list – and not all points I have answers to. More than enough reasons to write some follow-up posts in the future ;-).

So why this post? Just to share my experience in this story, and may be also to get feedback from this great community we have ;-). Any feedback is always appreciated – the community is here to make everyone and the product better!

The focus of this post is not on “how to develop in team”, but rather “what I think we need to take into consideration when you do”.

CI/CD

If you have never heard about “Continuous Integration”, “Continuous Delivery” and/or “Continuous Deployment” – now it’s time to dive into it :-). It’s a mature way of handling software these days – and very new for our precious NAV world. Let it be no doubt, also I realize there is no way to work in team without a decent implementation of CI/CD, so we have set up a system that automated quite a lot.

  • GIT with a remote in VSTS takes care of our “continuous integration” of the code of team members.
  • Branch for each “unit of work”
  • We have a master-branch-policy, which means we work with pullrequests to pull changes of our team members in the master branch by build definitions – which also forces us to review the code.
  • These build definitions do quite a lot (analyze, compile, test-deploy, manage manifest, …)
  • We have release pipelines to get our stuff to test-environments (continuous delivery/deployment)

And a lot more – part of which I will address in the upcoming points. Again, this is not about CI/CD, but you’ll see that the concept solves a lot of points, but also introduces some other challenges.

Object Numbers

A challenge you’ll face quite soon is “how to manage object numbers”. As a team, each member has his branch, within his branch, he will start creating tables, codeunits, … . But if you just use that awesome “auto numbering” that comes out of the box with the al-language .. you’ll end up with the same object numbers when you start merging your branch. Compile errors will cause many builds to fail!

You can’t just change the app.json to influence the autonumbering, because things will not compile in a while.

So, in a way, you need to abandon the nice autonumbering, and go into assigning object numbers to people/branches/workitems.

We created a dashboard app to manage all the things (we think) can’t be managed by VSTS – which also includes object numbers and field numbers.

“I need that field you are creating – can you save your object?”

I was a big fan of a central development database. Besides the fact you couldn’t develop in one object with multiple developers at the same time, it mostly had advantages. So easy. At all time, you had an overview of all developments everyone was creating.

Well, I guess I need to grow up now, because now, we are not developing in a database, we are developing in files, distributed on local systems/branches, integrated by VSTS .

So, if you need a field (or any piece of development for that matter) that was created in another branch, but not pushed to master just yet? Well, there are two ways – you start merging the two branches (which I wouldn’t do in a million years) – or you pull the change to master, so the other branch can merge with master, and continue development with those needed fields.

Does the field already exist?

An extra challenge which is quite similar to the above is the fact you don’t have an actual overview of all fields that are being created. Basically a list for all fields, for all tables, for all branches in development.

As said, we are being agile, so for functional and technical people, it’s very nice to be able to check who/what/.. Fields are already created that you can use in the next sprint.. . You can’t just open a table and see what fields are there – there might be some in extension objects – even not pushed to master yet.

We will create a dedicated functionality to “push” our fields from all branches to our dashboard so that we always have a nice up-to-date list to filter and analyse the fields we have at hand ;-).

Breaking schema changes during development phase

You’d say – during development, schema is not important. If you want to delete a field, just delete it. In the world of extensions these days, that means – you will delete all data that comes with your extension. Any breaking change needs to schema to be recreated. And I can tell you, you’ll end up with breaking changes quite soon:

  • Renumber a field
  • Rename a field
  • Delete a field
  • Change datatype

For a development database, I don’t care, but for a test-database, for User Acceptance Testing, or even just functionality testing, it can be devastating to lose the data.

We realized that quite soon in our development cycle, data became important .. and we are not “just” in development phase anymore. When the app ends up in the test system (during release-pipeline), it should be a matter of upgrading, not a matter of “delete data and recreate the schema”.

So the only thing I think we can do is to handle the app as being a release/live app from the very first moment users start testing/data is important. That means: the schema shouldn’t change anymore, and if you have to change schema, it’s a matter of using obsolete fields and creating upgrade scripts – just like you would do in live!

Well, we will be “in development” for about a full year, and during that year, people need to test, users need to perform UATs, … and basically this means if we make wrong assumptions in the analysis of our design and architecture (and in an agile world, it’s not that uncommon) – we might end up with (lots) of obsolete tables and/or fields.

As you might have noticed – I don’t really have a comfortable way of handling this just yet… working on it!

Dependencies

Dependencies is a nice ability we have with Extensions. But I can tell you, when you are developing the base app, and the dependent app at the same time .. In team .. It does bring some challenges as well.

In a way, we all are dependent from different symbols – as we all want to run our app in multiple countries .. . In my view, it’s a good idea to include in your build process a workflow that tests if your app would deploy on these countries as well. That’s why our build looks something like:

  • Compile
  • Run code analysis
  • Create app
  • Deploy on W1
  • Deploy on BE
  • Deploy on CountryX

Thanks to this, we already avoided an error in development where we added a field that already existed in the BE database .. . It compiled well in W1, but it didn’t in BE.

On top of that, you might create two apps, where one is dependent on the other. In that case, you also need to include in your build process to test that dependency at all times. A simple compile of the dependent app is easy, but actually, when you change the base app, you should also see if your dependent app still compiles. In our scenario, a change on the base app, results in a build of all apps that are dependent from it.

Distributed development environment

With C/SIDE, lots of partners implemented a “centralized development environment”, which is quite unorthodox, but C/SIDE allowed it, and it was super easy. At all times, the developments were in one database, one overview, on “thing” to maintain.

With AL, we are “forced” to do it the right way. This is positive, for sure, but it’s different. Now, code will have be “continuously integrated” (which is indeed the “CI” part) – which means, merged. You don’t “just” checkout (and reserve) and object, you commit and merge, work with branches, … . All good, but different.

We use Git on VSTS, and work with pullrequests to pull new code in the master branch, which means we have introduced a code review together with this. Good stuff!

Docker

But this distributed environment also brings some challenges, which Docker can solve. Everyone needs to work on his own isolated development environment – you can’t be deploying your apps to the same NST as your colleague.

Docker solves this – as it’s easy to create a local container so you could start development – but it also comes with the assumption that people are able to work with Docker.

We have seen this is a difficult one – lots of developers (including me) are not infrastructural-minded. And in that case, “docker” becomes a lot more difficult.

We decided to go for a managed approach – if the developer creates a branch, we will spin up a new environment for him to do his deployments. Thing is, we wanted to do this as easy as possible – with the possibility for him to work remote, with only one entrypoint, like: project.ifacto.be/branchname . With Docker, that gets more difficult, as now we can’t just depend on a serverinstancename (which in Docker is always “NAV”), but we need to do some routing for every container we spin up. It’s not just 1 IP with multiple services, but it’s always a different IP with 1 service.

The alternative is that every developer is going to manage his own docker container on his own VM on his own laptop. All of a sudden, we’d have to support local development environments of developers on their laptops – I don’t see that feasible, actually.. . At least not yet ;-).

Tests

With tests, we have one big “challenge”: it’s not possible to run a complete default test just yet. So for the moment, in our setup, running a complete test is not implemented.

But that doesn’t mean we can’t implement our own tests – and that’s something we do. And we also execute with every single build, triggered by the pullrequests.

On top of that, we should also test all the dependencies as well – if you change something on the base-app, it’s obvious that some dependent app might have failed tests.. That’s another reason to always rebuild the dependent apps as well. Keep that in mind ;-).

Translations

As you probably know, the way we will do translations has grown up as well. Developers don’t need to be linguistics anymore ;-). Translation is done through xlf-files, “outside” the code.

But this also means we need to manage that in our process.

All the team members will be creating their own branched xlf-file – which will conflict every single time you try to merge branches. So best thing is – handle translations totally outside the build-scope. At this point, I put the xlf-files in .gitignore. What I haven’t done yet is implement a workflow for handling translations just yet, because we don’t need it yet.

That’s it for now .. I hope this post at least opened some eyes, or confirmed some concerns, or even helped you in solving some of the points … . In any case, Belgium just lost their semi-finals on the World Cup – so I’m signing out and going to be grumpy now ..

Viewing all 339 articles
Browse latest View live