Public Preview for Microsoft Dynamics 365 Business Central 2023 release wave 1 (BC22) is available

The Public Preview of Microsoft Dynamics 365 Business Central is now available to Online Customers. Online Customers can create a Sandbox Environment with the 2023 Wave 1 Preview from the Dynamics 365 Business Central admin center.

As noted when creating the Preview Environment “Sandboxes on a preview version are intended only for testing and review of features coming in the next release. The environment may be updated to a new preview version or deleted with or without notice. The environment cannot be updated to a production version. It must remain in preview until it is deleted.”

Learn more about the new features in Microsoft Dynamics 365 Business Central 2023 Wave 1!

Real things I’m asked –What is ERP Software?

Enterprise Resource Planning (ERP) software is a business management software that helps organizations automate and integrate various aspects of their business processes, such as finance, human resources, supply chain management, inventory management, customer relationship management, and more.

An ERP system typically consists of integrated applications designed to collect and manage data from various departments in an organization. The software allows different departments to share information and communicate in real time, which can help streamline operations, improve efficiency, and increase visibility into business processes.

Some of the benefits of using ERP software include the following:

  1. Increased Scalability: An ERP system can grow and adapt to the changing needs of an organization, making it a flexible solution for businesses of all sizes.
  2. Improved Efficiency: ERP software integrates all business processes into one system, which helps to streamline operations and reduce the need for manual processes. By automating various functions, an ERP system can reduce the time and effort required to complete tasks.
  3. Enhanced Visibility and Better Decision-Making: ERP software provides a unified view of all business processes and activities, allowing managers and decision-makers real-time access to critical data and better decision-making.
  4. Enhanced Collaboration: By providing a centralized platform for data management, an ERP system can improve communication and collaboration between different departments in an organization.
  5. Better Inventory Management: ERP software helps track inventory levels, supply and demand, and can provide real-time data on inventory levels. It helps to reduce inventory carrying costs and prevent stockouts.
  6. Improved Customer Service: ERP software provides a centralized view of all customer data, including orders, returns, and customer interactions. Allowing for better customer service, faster response times, and improved customer satisfaction.
  7. Cost Savings: ERP software can help to reduce operational costs by eliminating the need for manual processes, reducing errors, and improving efficiency. It can also help to identify cost savings opportunities and reduce waste.
  8. Better Compliance: ERP software can help to ensure compliance with regulatory requirements by providing the necessary data and reporting capabilities to meet regulatory requirements.

In summary, ERP software can improve business operations, increase efficiency, reduce costs, and improve customer satisfaction.

Using an ‘OR’ Filter in Dynamics 365 Business Central with FilterGroup(-1)

In Microsoft Dynamics 365 Business Central, a FilterGroup contains a filter set on a Record. The current filter group can be set or retrieved with the following syntax:

[CurrGroup] := Record.FILTERGROUP([NewGroup])

Record Filters are set with the SetFitler, or SetRange Functions of a Record.

Record.SetRange(Field [,FromValue] [,ToValue]) 
Record.SetFilter(Field, String, [Value],...)

The filters set across different groups are in effect at the same time. To work with filters in a specific FilterGroup, you must first set the group and then apply the filter. Microsoft Dynamics 365 Business Central uses several FilterGroups internally within the application. The FilterGroup 0 is the user’s group when filtering from the filter dialog. A user cannot change filters set in a group other than 0.

Setting Record filters in Microsoft Dynamics 365 Business Central on multiple columns, all column filters are in effect and act as a “and” filter; only records that match the criteria in all filtered columns will be displayed.

When using the Customer list above, if we apply the filter ‘@*John*’ on the name column, all Customers that contain ‘John’ are returned in the record set.

var
    Customer: Record Customer;
begin
    Customer.SetFilter(Name, '@*John*');
    Page.Run(Page::"Customer List", Customer);
end;

Applying a Salesperson Code filter of ‘JO’ to the same Customer list returns all Customers with the Salesperson Code ‘JO.’

var
    Customer: Record Customer;
begin
    Customer.SetFilter("Salesperson Code", 'JO');
    Page.Run(Page::"Customer List", Customer);
end;

If the two filters are set together, we would only see a list of customers that match BOTH filter criteria.

The FilterGroup -1 allows you to perform a cross-column filter, treating the filters as individual filters, which act as an “or” filter. Setting the FilterGroup to -1 and applying the same set of filters, ‘*@John*’ to the Name and ‘JO’ to the Salesperson Code, results in a Recordset of Customers that have either ‘John’ in the name or JO as a Salesperson.

var
    Customer: Record Customer;
begin
    Customer.FilterGroup(-1);
    Customer.SetFilter(Name, '@*John*');
    Customer.SetFilter("Salesperson Code", 'JO');
    If Customer.FindSet() then
        repeat
            Customer.Mark(true);
        until Customer.Next = 0;

    Customer.MarkedOnly(true);

    Page.Run(Page::"Customer List", Customer);
end;

Cross-column filters do not work within the user interface. If you’d like to display the records on a page, you must do it differently by marking them using a temporary record set or another option.

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

Tag a Commit with Git in VS Code

Git Tag is a reference to a specific point in Git history. It marks specific releases or versions of your codebase, allowing easy recall of the exact code associated with that Tag. A Tag may track software version releases, identifies significant changes, or annotate a point in the project’s history. Git Tags are immutable; they cannot be changed once they are created. You need to delete and recreate the Tag, although the Tag can update to another commit.

As tags are intended, I often tag project commits to version codebase changes. In a recent conversation about Git Tags, a topic I am sure many do not find as exciting as I did, I reviewed how I create Tags to version commits through VS Code.

To Tag a version based on a commit, you need to know to identify the commit. A commit log is displayed when the command git log –pretty=oneline is executed in a VS Code terminal.

The commit log displayed the commit id, a tag if it exists, and the commit comment.

The syntax to tag a commit is git tag -a <tagname> -m <messge> <commit id>
After a commit is tagged, the tag information is displayed in the list, as in the following screenshots.

After a Tag, or Tags, is created, they must also be committed to the repo. Within VS Code this can be done by using the Git: Push Tags command.

After being Pushed, tags are visible in the repo.

The screenshots are from a repo(ository) that I created a few months ago to track and review Microsoft Dynamics 365 Business Central releases (I know there are many other repos for this; sometimes it is good practice to go with it too)

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

February 2023 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The February 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 21.4 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 2 Updates – Update 21.4 (February 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.10 (February 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.16 (February 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 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.19 (January 2022)

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 44 (February 2023)

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

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

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

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Dynamics 365 Business Central – Sales Invoice Discounts

Companies in price-sensitive markets often need flexible pricing strategies to attract and retain customers. One way to do this is by offering discounts, either individually or to groups of customers.
In Microsoft Dynamics 365 Business Central, two sales discounts are available: line and invoice discounts.

In a previous article I had discussed the how to offer the discount features at the order-line level based on various criteria in Microsoft Dynamics 365 Business Central. 

In addition to Sales Line Discounts, you can use a Sales Invoice Discount. A Sales Invoice Discount in Microsoft Dynamics 365 Business Central is a percentage discount subtracted from the document total if the value of all lines on a sales document exceeds a certain minimum. The discount is calculated based on all lines, not only item(s) on the sales document where the Allow Invoice Disc. (Note: The Allow Invoice Disc. field may need to be made visible on the page view. The default for an item can also be set on the Item Card) value is checked. By default, invoice discounts are allowed. However, lines with item charges, for example, are not included in the calculation of the invoice discount.

Sales Invoice Discounts are set for each customer by selecting the “Invoice Discount” action from the Related menu on the action ribbon. Enter the requirements, such as Currency Code, Minimum Amount and/or Service Charge for the Invoice Discount on the Cust. Invoice Discounts page.

When using invoice discounts, it’s important to decide if they will be calculated automatically or manually. The “Calc. Inv. Discount” setting on the Sales & Receivables Setup page Specifies if the invoice discount amount is automatically calculated on sales documents. If the check box is selected, the invoice discount amount is calculated automatically, based on sales lines where the Allow Invoice Disc. field is enabled. When not calculating Sales Invoice Discounts automatically, they are manually calculated by selecting the “Calculate Invoice Discount” action from the Related Menu Item (refer to previous screenshot). 

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

Dynamics 365 Business Central – Sales Line Discounts

Companies in price-sensitive markets often need flexible pricing strategies to attract and retain customers. One way to do this is by offering discounts, either individually or to groups of customers.
In Microsoft Dynamics 365 Business Central, two sales discounts are available: line and invoice discounts.

The discount features in Microsoft Dynamics 365 Business Central include offering discounts at the order-line level based on various criteria and providing discounts to customers at the invoice level. The discount functionality is also fully integrated into all relevant sales, marketing, and accounting processes, making it easy and consistent.

Working with Sales Line Discounts 

In Microsoft Dynamics 365 Business Central, Sales Line Discounts are item-related discounts assigned to customers based on conditions such as minimum item quantity, unit of measure, or date range.

Open the Sales Line Discounts page from the Item Card or Customer Card by selecting Line Discounts action from the Prices & Discounts Menu.

  • Enter the Sales Type for the discount
    • Customer – the line discount is for a specific Customer
    • Customer Disc. Group – the line discount is for Customers assigned to a Discount Group.
    • All Customers – the line discount is for All Customers.
    • Campaign – the line discount for a Sales Campaign
  • Sales Code – enter the value related to the Sales Type value for the Sales Line Discount. 
    •  Sales Type of Customer – Enter the Customer No for the Customer that receives the line discount
    • Sales Type of Customer Disc. Group – Enter the Customer Disc. Group for the Group that receives the Sales Line Discount
    • Sales Type of All Customers – no value entered
    • Sales Type of Campaign – Enter the Campaign that receives the Sales Line Discount
  • Enter the Type for the discount
    • Item – the line discount is for a specific Item
    • Item Discount Group – the line discount is for Items assigned to a Discount Group.
  • Code – enter the value related to the Type value for the Sales Line Discount 
    • Type of Item – Enter the Item No for the Item with line discount
    • Type of Item Discount Group – Enter the Item Discount Group for the group of items with the line discount
  • Unit of Measure Code – If the line discount is for a specific Unit of Measure Code, enter the unit of measure code for the type sold that receives the Sales Line Discount, if applicable
  • Minimum Quantity – if the Sales Line Discount is applicable for a minimum quantity ordered for the Item, enter the minimum quantity needed to receive the Sales Line Discount.
  • Starting Date and Ending Date – If the Sales Line Discount is effective for a specific date range, enter the starting and ending date for the date range the Sales Line Discount is valid
  • Line Discount % – the line discount for the Item, for the Sales Line Discount options.

When working with Customer Disc. Groups, a Customer can be assigned to a Discount Group by populating the Customer Disc. Group value on the Invoicing Fast Tab of the Customer Card.

When working with Item Disc. Groups, an Item  can be assigned to a Discount Group by populating the Item Disc. Group value on the Invoicing Fast Tab of the Item Card.

You can read more on how to Manage Sales Prices in Business Central here.

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

Real things I’m asked – Add Test Users to a Business Central Docker Container

Q: How do I add test users to a Microsoft Dynamics 365 Business Central Docker Container?

A: You use the Setup-BcContainerTestUsers function in BCContainerHelper to load test users.

You can load either Essential or Premium users with the Setup-BcContainerTestUsers function.

When working with a Business Central Container that has the following Users:

New test users can be added with the Setup-BcContainerTestUsers function:

#set the userName, password and containerName values for your use
$userName = 'admin'
$password = 'password'
$containerName = 'your container'
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($userName, $securePassword)


# the $SecurePassword is the password  that the new test users will use when logging into Business Central
Setup-BcContainerTestUsers -containerName $containerName -select Essential -Password $securePassword -credential $Credential
Setup-BcContainerTestUsers -containerName $containerName -select Premium -Password $securePassword -credential $Credential  

After setting up the test users with the Setup-BcContainerTestUsers function in BCContainerHelper:

The new TestUsers can access the system using the password used in the Password parameter.

Note: You need to specify credentials when not using Windows Authentication.
The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 2 online and BCContainerHelper Version 4.0.8. 

January 2023 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The January 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 21.3 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 2 Updates – Update 21.3 (January 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.9 (January 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.15 (January 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 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.19 (January 2022)

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 43 (January 2023)

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

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

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

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Dynamics 365 Business Central – TryFunction

The TryFunction attribute in AL, when developing for Microsoft Dynamics 365 Business Central, indicates that a method is a Try method.

A Try method in AL enables you to handle errors that occur in the application during code execution. For example, with try methods, you can provide more user-friendly error messages or manage the execution of code on an error.

A method in AL marked with TryFunction Attribute will execute any code within the method function as a Try [to execute the code] block. If the code executes without raising an error, it will return a true result and a false one in the case of an error.

In the following example, there are three separate methods for comparing integers. All three methods will generate an error if two integers are not equal.

var
    NotEqualErr: label 'Values must be equal.';

procedure CompareIntegers(a: integer; b: Integer)
begin
    if (a <> b) then
        Error(NotEqualErr);
end;

[TryFunction]
procedure TryCompareIntegers(a: Integer; b: integer)
begin
    if (a <> b) then
        Error(NotEqualErr);
end;

[TryFunction]
procedure TryCompareIntegersMulti(a: Integer; b: integer)
begin
    CompareIntegers(a, b);
end;

Calling the first method with two non-matching integers will generate an error:

CompareIntegers(6, 5);

The second and third methods are marked with the TryFunction Attribute, and we can code to check if the methods executed without error:

If not TryCompareIntegers(6, 5) then
            Message('Try Failed.');

When a method is marked with the TryFunction Attribute it will allow for catching of errors with the callstack as with the third method:

If not TryCompareIntegersMulti(6, 5) then
            Message('Try Multi Failed.');

Note: Calling the TryFunction methods without checking for an error in execution will result in normal error processing.

You can learn more about the TryFunction Attribute in Dynamics 365 Business Central here.

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