videoAL Developmentofficial - Microsoftreviewed - checked by Opus

What's New in AL: Embedding Resources in Applications (2024 release wave 2)

Embedding resources in AL applications (2024 release wave 2): files such as CSV data and images go in a resources folder in the app and are read with a get resource function. The video says the feature could not be used yet at recording. It covers folder setup, the uniqueness rule and size limits.

  1. 0:00 Introduction to resources in applications
  2. 0:47 Overview of the resources folder structure
  3. 1:28 Using the get resource function
  4. 2:46 Multiple resource folders configuration
  5. 3:27 Uniqueness constraint and compilation
  6. 4:42 Limitations and constraints
  7. 5:38 Summary and conclusion
video Microsoft Dynamics 365 Business Central (YouTube) · 2024-10-08Watch on YouTube

Overview

The video introduces resources in applications, which lets a developer ship files with an extension. Files such as CSV data or images are placed in a resources folder, and the app returns the resource for that specific application and version. The presenter says up front that the feature cannot be used yet, but that code using it will appear fairly soon, possibly in BC apps.

The demo covers the resources folder structure, a get resource function that reads a resource by file name and relative path into a stream, and configuring several resource folders. It then explains the uniqueness constraint checked at compilation, and the size and count limits.

Key points

  • Resources are shipped in a resources folder inside the app file, for example CSV data and images.
  • The get resource function takes a file name and relative path and puts the resource into a specified stream.
  • Several resource folders can be configured, such as one for images and one for data files.
  • The resource name including its path relative to the resource folder must be unique within the extension, or compilation fails.
  • Limits: 1,024 KB per resource, 16 MB for all resources in an extension, and 256 resources per extension.
  • Embedded resources are read-only, because an app package cannot be changed after shipping, and only the owning extension can access them.
  • The server validates resources at publish time: invalid file extensions, failed MIME type checks or virus scan detections block publishing.

Features

Feature Status At
Embedding resources in applications status not stated, demoed 0:06
get resource function status not stated, demoed 1:28
Multiple resource folders status not stated, demoed 3:06
Resource size limitations status not stated 4:42
Read-only resources status not stated 5:18

AL objects mentioned

As heard in the captions. A name that matches one object page by exact type and name links to it; the others stay as named.

  • other “NavAdType” at 1:28

Quotes

  • 0:06 “I have some code to show you and it’s going to be really exciting but first I have to say you can’t use it”
  • 0:27 “resources in applications meaning you can ship your resources with your application get the resource for that specific application for that specific version”
  • 3:27 “the resource name including the path relative to the resource folder must be unique within the extension”
  • 5:18 “the resources are only only available from the extension that owns the resource”
  • 5:38 “if your file extensions are not valid on the server that you want to deploy it to all the mime types checks will fail”

Disclaimers in the video

  • 0:06 preview: you can’t use it not right now at least so why do we even talk about it well you’re going to see some uptake of this feature fairly soon
  • 0:27 coming-later: you’re going to see the code maybe in BC apps and other places so this is important that you know what it’s all about

Presenters (as heard): Stepen B.