Powered by Smartsupp
Back

What’s new in developer tools

What’s new in developer tools

This year’s Directions EMEA conference brought a wealth of interesting insights from the world of Business Central. As the system evolves, so do the tools that enable system development.  In the latest version of the system (2023 wave 2), several improvements have been made for developers.

1. Namespace

A namespace is a way of organizing different names or identifiers that belong to a certain group or context

  • Grouping objects based of functionality to improve discoverability
  • Reduce/prevent name collisions

Namespaces – Syntax

  • First statement in source file
  • Covers all objects in the file
  • Namespaces can be nested with a dot
  • Namespace names must be CLS compliant
  • The same namespace can be used in multiple files
  • The same namespace can be used in multiple modules

Screenshot of AL codeunit Namespaces – Syntax.

Picture source: Directions EMEA 2023

Namespaces – Using directive

  • Using directives brings all objects from a namespace in scope
  • There is no ordering

Screenshot of AL codeunit Namespaces – Using directive.

Picture source: Directions EMEA 2023

Namespaces – fully qualified names

  • Alternative to using directives
  • Specific to a single object
  • Removes risk of name clashes

Screenshot of AL codeunit Namespaces – fully qualified names.

Picture source: Directions EMEA 2023

Namespaces – 2 rules

  1. Only one object of a kind with the same name in a module
  2. Only one object of a kind with the same name in a namespace

Namespaces – AL Explorer

Screenshot of AL Explorer Namespaces – Events tab showing namespaces for vendor entry objects.

Picture source: Directions EMEA 2023

2. Investigate and troubleshoot

Explore and Debug in VS Code from web client

Overview of Explore and Attach options

Screenshot of Business Central vendor card with page inspection pane open.

Picture source: Directions EMEA 2023

Permissions

  • None for Attach in Help and Support
  • “Troubleshooting tools” for Page Inspector options

Screenshot of permission set for Troubleshoot Tools extension.

Picture source: Directions EMEA 2023

Error details including call stack

The Error Call Stack specifies the call stack where the error occurred.

Screenshot of Business Central error log with support link and call stack.

Picture source: https://yzhums.com/17861/

Screenshot of validation error for phone number with copy details option.

Picture source: Directions EMEA 2023

IntelliSense in debugger console

With 2023 wave 2, the console supports IntelliSense for object types and members that can be evaluated in the context of the debugger: fields, locals, globals, and member symbols that are not methods on a data type.

Screenshot of AL debugger console with IntelliSense suggestions.

Picture source: https://yzhums.com/43256/

Additional sampling intervals in profilers

Microsoft has added new settings that allow users to choose between 50, 100 and 150ms.

Screenshot of Performance Profiler with new sampling interval options.

Picture source: Directions EMEA 2023

Screenshot of profiler code with sampling interval options.

Picture source: Directions EMEA 2023

Recap: Sampling during profiling

Screenshot of profiling showing function execution timeline.

Picture source: Directions EMEA 2023

3. AL Language

Variant

Variant to Dictionary/List  – it is now possible to assign List and Dictionary to a Variant. The Variant type has been augmented with two new properties IsList and IsDictionary to allow for detecting if it contains the relevant types.

New variant type methods:

  • IsDictionary – represents an unordered collection of keys and values. The Dictionary data type is optimized for fast lookup of values.
  • IsList – represents a strongly typed list of ordered objects that can be accessed by index. Contrary to the Array data type, a List is unbounded, such that its dimension does not need to be specified upon declaration.

Screenshot of AL code showing Variant type with new IsList and IsDictionary methods.

Picture source: https://yzhums.com/42578/

Secure Text

  • New datatype for variables, returns value and parameters
  • Protects data from being inspected in the AL Debugger
  • Set SecureText in methods attributed with [NonDebuggable]
  • Pass on SecureText internally in your extension

Screenshot of AL code showing SecureText variable.

Picture source: https://yzhums.com/42691/

Fieldgroup

With this new feature, table extensions will be able to add a FieldGroup to existing tables.

The way this works is that a table extension can add fields by using the “addlast” keyword in the Dropdown or Brick field groups, as today. However, if the field group doesn’t exist on the table, which is being extended, it will be created.

Screenshot of AL table extension adding fields with fieldgroups.

Picture source: https://yzhums.com/42611/

Screenshot of Business Central customer card with Customer Posting Group dropdown.

Picture source: https://yzhums.com/42611/

Add existing table fields

  • Get to data faster, without costly development
  • Many more fields to choose from, under All fields
  • Added table fields are never editable
  • Available in for Role Customization

AllowInCustomizations

  • Always allow (default)
  • Never allow

Screenshot of AL code and Business Central page customization showing AllowInCustomizations set to Always and Never.

Picture source: Directions EMEA 2023

Screenshot of AL page customization code adding custom fields after “Bill-to Customer No.” in Business Central.

Picture source: Directions EMEA 2023

Screenshot of AL error message about invalid field usage in page customization.

Picture source: Directions EMEA 2023

AnalysisModeEnabled

AL developers can turn off the data analysis mode using page object metadata.

On by default. Sets a value that specifies whether analysis mode on the page is allowed.

Disable analysis mode for list or worksheet page.

Screenshot of AL code showing list and worksheet pages with AnalysisMode disabled.Picture source: Directions EMEA 2023

Query from RunObject

With this feature, developers can make queries more easily available to client users who need to do ad hoc data analysis. Can be added the query as an action on pages using the RunObject property.

Screenshot of AL code showing a page extension adding a query action with RunObject property for ad hoc analysis.

Picture source: https://yzhums.com/43703/

Screenshot of Business Central customer card with a Run Test Query action button highlighted.

Picture source: https://yzhums.com/43703/

ExcelLayoutMultipleDataSheets

Multiple Data Sheets in Excel.

Simplifies complex reporting with multiple datasets in a single Excel report.

Screenshot of AL report code with ExcelLayoutMultipleDataSheets enabled for multiple Excel sheets.

Picture source: Directions EMEA 2023

Screenshot of Excel report with multiple data sheet tabs, including Customer, Report Metadata, and PopulationDetails.

Picture source: Directions EMEA 2023

Navigate: “Find all references” improvements

Find All References command to find where particular code elements are referenced throughout your codebase. The Find All References command is available on the context (right-click) menu of the element you want to find references to. Works on triggers, system methods, and trigger events.

Screenshot of AL code editor showing all references to the OnInsert trigger.

Picture source: Directions EMEA 2023

Rich Content fields

A native part of the platform, including

  • Toolbar with keyboard shortcuts
  • Support for formatting, images, links, tables
  • Copy & Paste
  • Multi-line, moderate sizing
  • HTML output

Ideal for authoring multi-media content, such as an email body, social media post or rich notes.

Screenshot of AL code adding a Rich Text field to the Customer Card using the RichContent datatype.

Picture source: https://yzhums.com/41989/ 

Screenshot of Business Central Customer Card with a Rich Text field.

Picture Source: https://yzhums.com/41989/

Latest blogs

Contact us

Would you like to learn more? Let's get in touch.

Contact us

Sending...
Your message has been sent successfully
Back to home