Dynamics 365 Business Central 2022 Wave 2 – Launch in a specific company from Visual Studio Code

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2022 Wave 2 has several exciting new features in the development environment. One of the exciting features is the Launch in a specific company from Visual Studio Code.

When publishing Dynamics 365 Business Central applications from within VS Code, the launch.json file specifies the configuration of the environment to which the extension is published and launched when you debug or test your app.
A new, optional parameter, startupCompany, exists in Dynamics 365 Business Central. The startupCompany specifies the company’s name to open after publishing the extension. Previously, you would need to change the company within the client environment.

Read more on startupCompany parameter here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central Public Preview 2022 Wave 2.

September 2022 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The September updates for Microsoft Dynamics NAV and Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that SaaS customers will automatically be upgraded to 20.5 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.5 (September 2022)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.11 (September 2022)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.17 (September 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.17 (October 2021)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 39 (September 2022)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 56 (September 2022)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Dynamics 365 Business Central: Setup a Public Preview Development Environment

As of this writing, Microsoft has a published schedule of two major annual updates of their Dynamics 365 Business Central ERP software product. These updates, referred to as “Waves,” are released in April and October. Approximately one month before the “Major Release,” Microsoft makes a “Public Preview” available to the public.

How do you access a Preview Environment (version) once its availability is announced?

You can access a “Public Preview” version of Dynamics 365 Business Central in two ways.

The first way to access the environment is to create a Sandbox Environment through the Dynamics 365 Business Central admin center.

  1. Login to your Dynamics 365 Business Central admin center
  2. Select the Environments option 
  3. Select + New to create a new Environment
  4. Enter a unique Environment Name in the Create Environment page
  5. Choose the Sandbox for the Type
  6. Select the desired Country
  7. Select the version labeled as Preview from the Version drop down list
  8. Click the Create button 

The second option to access the environment is to create a Preview Docker Container using PowerShell. 

  1. Install the BCContainerHelper Module if not installed.
  2. Create a new BC Container using the Preview Container artifacts. The following is an example script, which you should adjust for your environment and options. 
 ############################################################################################################

$containername = 'Preview'
$UserName = 'admin'
$Password = 'password'
$SecurePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($UserName,$SecurePassword)

############################################################################################################

$artifactUrl = Get-BCArtifactUrl  -country "us" -select Latest -type Sandbox -storageAccount BcPublicPreview

New-BCContainer  `
    -accept_eula `
    -containerName $containername `
    -auth NavUserPassword `
    -artifactUrl $artifactUrl `
    -accept_outdated `
    -Verbose `
    -updateHosts `
    -alwayspull `
    -includeAL `
    -Credential $Credential `
    -isolation hyperv 

How do you access a Preview Development Environment ?

  1. Create a Preview Docker Container
  2. Open Visual Studio Code and open the Extension Page
  3. Select the ellipsis in the Extension menu and choose the “Install from VSIX…” menu option
  4. Browse for the ALLanguage.vsix file Note: The AL Language extension file is located in the ModernDev folder of the installation media for the Preview Docker Container. The Preview AL Language Extension may also be retrieved using the Get-AlLanguageExtensionFromArtifacts cmdlet. Example:
    $artifactUrl = Get-BCArtifactUrl -country "us" -select Latest -type Sandbox -storageAccount BcPublicPreview

    Get-AlLanguageExtensionFromArtifacts -artifactUrl $artifactUrl
  5. Click Install
  6. Reload to Refresh the AL Language Extension

Read more on how to prepare for major updates with preview environments here.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central Public Preview 2022 Wave 2

It’s Friday – September 02

Dynamics 365 Business Central: SecurityFilter Option Type and Security Filters

Dynamics 365 Business Central uses Security Filters to manage record-level security. A Security Filter limits the set of records in a table that a user can access.

When Security Filters are applied, the user’s access to data is limited. There may be instances where the desired code behavior may conflict with using Security Filters. The SecurityFilter Option Type allows a developer to specify how Security Filters apply to records in code. The SecurityFiltering Method sets or gets the SecurityFilter Option for a record instance.

SecurityFiltering Method Syntax:

[SecurityFiltering := ] Record.SecurityFiltering([SecurityFiltering: SecurityFilter])

The SecurityFilter Option Type has four options:

Validated:  This is the default value. Filters are respected, and an error is raised if access to a record outside the filtered set is attempted.

Filtered: Filters are respected, and records outside the filtered set do not exist for the user. 

Ignored: Security Filters are ignored for the record instance.

Disallowed: An error is raised if there is a security filter set for the record instance.

To demonstrate the SecurityFiltering on a record, I will use the Permission Set with the Security Filter discussed in a previous post.

With a Security Filter set for the user’s Permission Set, the SecurityFiltering Method use can be demonstrated

 

with the results

 

The example demonstrates the filtered record count with the Security Filter Filtered and with the Security Filter Ignored.

Read more on the SecurityFilter Option Type and SecurityFiltering Method.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 1

Service stopped? Restart it with PowerShell

In a previous article, I discussed changing a Windows Service Log On Account information using the Set-Service PowerShell cmdlet. Just as the Set-Service cmdlet modifies the properties of a Windows Service, the Get-Service cmdlet gets a Windows Service properties.

 

Running the Get-Service cmdlet without any parameters will list the Status,  Name, and DisplayName of each service on a system. Using the Get-Service cmdlet with a combination of parameters lists the services that match the criteria.
 
Return a list of Services that start with the Name Microsoft:
Get-Service -Name "Microsoft*"
Return a list of Services that begin with Microsoft and do not contain WS:
Get-Service -Name "Microsoft*" -Exclude "*WS*" | Format-Table -Property Name, Status, StartType, DisplayName
Note: You can use the PowerShell Format Commands to change the output view.
Return a list of Services with a Name that begins with Microsoft and a Status of Stopped:
Get-Service -Name "Microsoft*" | Where-Object {$_.Status -eq "Stopped"} | Format-Table -Property Name, Status, StartType, DisplayName
The Set-Service cmdlet modifies service properties, and the Status is one of those properties.
Start the Service with a Name MicrosoftDynamicsNavWS:
Set-Service -Name MicrosoftDynamicsNavWS -Status Running 
 
The service list returned from the Get-Service cmdlet may be piped to the Set-Service cmdlet to restart a stopped service. In this example, services that begin with MicrosoftDynamicsNAV and have a Stopped status pass to the Set-Service cmdlet to start:
Get-Service -Name "MicrosoftDynamicsNav*" | Where-Object {$_.Status -eq "Stopped"} | Set-Service -Status Running

The stopped services with a name beginning with MicrosoftDynamicsNav start on the machine, unless there is something preventing the service from starting.

Note: The code and information discussed in this article is for informational and demonstration purposes only. 

It’s Friday – August 26

Dynamics 365 Business Central: Using Security Filters to Limit Data

Within Microsoft Dynamics 365 Business Central, user access is controlled by assigning User Groups and/or Permission Sets to a user on the User Card. A Permission Set is a group of permissions that control access within Business Central. A User Group is a set of Permission Sets, which simplify the assignment of Permission Sets based on user functions or roles.


Security Filters manage Record Level Security in Dynamics 365 Business Central. Security Filters are applied to TableData Objects in a Permission Set to limit the data for a Permission Set Object. For example, a Security Filter is applied to the Customer TableData object if the need is to restrict the customers available to a permission set.

To Limit Data with a Security Filter:

  1. Search for “Permission Sets” using the “Tell Me” action in the App Bar and click the “Permission Sets” list link
  2. Select the Permission Set that will have the Record Level restriction and click “Permissions” in the action bar
  3. Go to the row for Table Data you would like to filter and click on the ellipsis button in the Security Filter Column.
  4. Enter the Field Number (or select from the list by clicking the ellipsis button in the Field Number Column. The Field Caption will display on the row.
  5. Enter the Field Filter to apply to the selected field Note: Security filters do not support wildcard characters (* or ?)
  6. Repeat Steps 4 and 5 for each field that should have a filter applied
  7. Click Close on the Table Filter Page
  8. Repeat steps 2 through 7 for each TableData Permission that requires a Security Filter

Users with the Permission Set with the Security Filter applied will see restricted data.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 1

It’s Friday – August 19

Dynamics 365 Business Central: AllowScheduling Property

One great feature of Microsoft Dynamics 365 Business Central is the option to schedule Reports. As beneficial as this feature may be, there may be cases where the opportunity to schedule a report is not desired. Fortunately, there is a way for a report developer to control this option.

The ability to schedule a report is handled through the AllowScheduling Property of the report definition. When creating a report, a developer can determine if the report can be scheduled in the background and executed by the Job Scheduler using the AllowScheduling property. 

Setting the AllowScheduling Property to true shows the Schedule option on the report dialog that appears after the “Send To…” button is clicked.

Setting the AllowScheduling Property to false hides the Schedule option on the report dialog that appears after the “Send To…” button is clicked.

In Microsoft Dynamics 365 Business Central, the default behavior of the AllowScheduling property is true. The AllowScheduling Property cannot be changed on Report Extensions.

Click to read additional information on the AllowScheduling Property.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 1