Sunday, February 21, 2021

Automated PowerShell Script v2.1 to Recreate My Business Central Docker Containers

 By Steve Endow


UPDATE:  I have posted version 3 of the script here


In July 2020 I posted an earlier version of this script.  This updated version has a few refinements, such as removing and importing BcContainerHelper to ensure the latest version is being used, adding Flush-ContainerHelperCache to remove old helper files, and removing old Docker images.

Automate, Automate, Automate

I setup a "Dev Container" task in Windows Task Scheduler to run this script every morning at 6:45am so that I always have a fresh BC container based on the latest BC artifacts.  I call my main Container "dev17", based on the current 17.x version of Business Central.  Do NOT name your container just "dev"--see my video here on why that will cause problems.


Tuesday, February 16, 2021

Changing the network location from Public to Private on Windows Server

By Steve Endow

This is just a post for me to store this information for Future Steve, as he will most certainly need it, just as Present Steve has needed it a dozen times over the last year.

Any time I replace my router, replace a piece of Ubiquiti network gear, or reconfigure my network, all of my Windows Server VMs decide they've been kidnapped and change their network location to Public network.

This blocks all traffic on the servers until I can login directly to each server and fix the problem.

Which requires an annoying process using gpedit or PowerShell, which I can never remember after 6 months.

So here is the post with the information to fix the problem:

https://serverfault.com/questions/639088/how-do-i-make-a-connection-private-on-windows-server-2012-r2

Using the GUI:

  1. Hit Winkey + R to open Run prompt and type gpedit.msc
  2. Navigate to: Computer Configuration/Windows Settings/Security Setting /Network List Manager Policies.
  3. Choose your Network name in the right pane.
    Note: To show networks not currently connected, right-click Network List Manager Policies in the left pane and choose Show All Networks.
  4. Go to Network Location tab and change the Location type from Public to Private.


Using PowerShell...

One line version:

Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private

Multi-line version:

PS C:\>$Profile = Get-NetConnectionProfile -InterfaceAlias Ethernet1

PS C:\>$Profile.NetworkCategory = "Private"

PS C:\>Set-NetConnectionProfile -InputObject $Profile


Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central, Microsoft Power Automate, Power Apps, Azure, and .NET.

You can also find him on Twitter and YouTube

Friday, February 12, 2021

Creating a simple text file using AL in Business Central - Sample Code

 By Steve Endow

On January 23, 2021, I recorded a video showing how to create a simple text file using AL in Business Central.


Here is the video:

https://www.youtube.com/watch?v=_GUzlFKJFQk


Below is the sample code from that video.

PowerShell script to remove old Docker Images without deleting the base OS image

 By Steve Endow

If you are creating Business Central Docker Containers and regularly updating the artifacts and images for your containers, you may be familiar with this problem.

When you type "docker images" in PowerShell, you are greeted with a pile of old unused images consuming tons of disk space.

A digital junk drawer

I want to delete the old, unused Docker images.  But I do not want to delete the 10.4 GB "base OS" image that is listed at the very bottom.  As long as my OS version remains the same, that image can be used repeatedly, and if I deleted it, I would have to download it again.

Disable Browser Autofill with Business Central

 By Steve Endow

While using Business Central with Google Chrome, I started to notice strange words appearing in Business Central fields while I entered data in the browser.

Why are you doing this?

In this example, the word "test" was appearing when I clicked on the drop down list for bank accounts in Business Central.  The suggested value was in a text box displayed over the standard Business Central list box.

Tuesday, December 1, 2020

Disable Two Factor Authentication on Business Central Demo Sandbox Environments

 By Steve Endow

I have created a Business Central SaaS demo sandbox tenant by following the steps outlined by Erik Hougaard in his video here:

https://www.youtube.com/watch?v=u_anE1exnPM


UPDATE:  Microsoft has changed the "Sign Up" process for a new Microsoft account. See the comments below Erik's video for a direct link to the new account page.


The new Business Central sandbox works great at first, but after a few days, when you login to the demo Business Central tenant, you will be prompted to enable Two Factor Authentication for the demo Microsoft login.


This is due to enhanced Azure security settings called "Security Defaults".  While these settings are probably a good thing for most organizations, I don't need 2FA for a demo BC sandbox.

Here's how to turn off Azure Security Defaults.


Login to portal.azure.com using your demo Microsoft login

Expand the Azure menu on the left and click on Azure Active Directory


On the Azure Active Directory Overview page, scroll down the menu on the left and click on Properties


When the Tenant properties page is displayed, scroll to the bottom and click on Manage Security defaults


The Enable Security defaults option should be displayed


Change the setting to No

Click on Save


This should disable 2FA for the Business Central demo tenant.


Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central, Microsoft Power Automate, Power Apps, Azure, .NET, Dynamics GP, and SQL Server.

You can also find him on Twitter and YouTube

https://www.precipioservices.com

Friday, November 6, 2020

Page Inspection Keyboard Shortcut CTRL+ALT+F1 Doesn't Work on Laptop

By Steve Endow


Update: I originally wrote this post referencing my Lenovo ThinkPad P1 laptop, but it appears that similar Intel Graphics software is used on several different laptop brands and models, causing the same issue.  The name or appearance of the specific Intel Graphics software may vary, but the concept still applies.


If you use Dynamics 365 Business Central, you should be aware of the Page Inspection feature.

Inspect my page

https://docs.microsoft.com/en-us/dynamics365/business-central/across-inspect-page

One of the ways to open the Page Inspection pane while viewing a Business Central page in a browser is to press the keyboard shortcut CTRL + ALT + F1.

Handy Keyboard Shorcut


While doing some BC development and testing on my new Lenovo ThinkPad P1 laptop, I pressed CTRL + ALT + F1 to open Page Inspection.

But nothing happened.

How many digits can a Business Central Amount field actually support?

 by Steve Endow (If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!) On Sunday nig...