AL Language extension 14.2
AL Language extension 14.2 for Business Central 2024 release wave 2 (BC25): released 2024-12-11; 3 changelog entries.
- BC25Business Central
- 2024-12-11released
- 3entries
- 0issues
Changelog on the Visual Studio Marketplace · Business Central 2024 release wave 2 · BC25
Resources in extensions
Resource files can now be packaged as part of an extension. To add resources to your extension, the following property has to be set in your app.json:
"resourceFolders": [<list of folders that contain resources>]
The folders should be listed relative to the root of your project. For example:
"resourceFolders": ["Resources"]
This will include all files under the folder ‘resources’. The resource folders themselves can contain additional subfolders. For example, you could have the following folder structure:
MyApp
| - Resources/
| - Images/
| - MyImage.png
| - Configuration/
| - MyConfiguration.json
| - src/
| - MyCodeunit.codeunit.al
Access to these resources is done through the NavApp.GetResource("resource name": Text; var instream: Instream; [optional] encoding: TextEncoding) method. The name of a resource is its path from the root of its resource folder. So for the folder structure above, you can do:
procedure MyProc()
var
resultStream: Instream;
jsonText: Text;
begin
NavApp.GetResource("Images/MyImage.png", resultStream);
// Do stuff with the blob in the resultStream object
NavApp.GetResource("Configuration/MyConfiguration.json", resultStream, TextEncoding::UTF8);
jsonText := resultStream.Read(jsonText);
end
There are also the methods NavApp.GetResourceAsText("resource name": Text; [optional] encoding: TextEncoding): Text and NavApp.GetResourceAsJson("resource name": Text; [optional] encoding: TextEncoding): JsonObject that directly retrieves resources as Text or JsonObject types.
The method NavApp.ListResources([optional] filter: Text) is also provided to allow for iteration over resources. The filter value for the method can contain wildcards. If it does not contain wildcards, then any resources with the filter text within its name will be returned. For example:
/**
* For the following resource structure:
* Resources/
* Images/
* SampleImage1.png
* SampleImage2.png
* SampleImage3.jpg
* TemplateImage.jpg
* Snippet/
* SampleSnippet.txt
* TemplateSnippet.txt
*/
// This will return: ["Images/SampleImage1.png","Images/SampleImage2.png","Images/SampleImage3.jpg", "SampleSnippet.txt"]
NavApp.ListResources("Sample");
// This will return: ["Images/SampleImage1.png","Images/SampleImage2.png"]
NavApp.ListResources("Images/*.png")
Resources can only be accessed within the scope of the app that contains them. This means that there is no way to access the resources of another app.
AppSourceCop
- Addressed issues executing page breaking change validation rules AS0029, AS0035, and AS0040 on pages whose source tables jave been moved tables to another extension, for instance ‘No. Series’.
Miscellaneous
- Fixed an issue where race conditions would occur if a code action that is invoked on project or workspace scope tried to change large number of files.
- Fixed an issue that caused the runtime to fail, when calling methods from extended interfaces on an instance of the derived interface.
Source: Visual Studio Marketplace, ms-dynamics-smb.al changelog, Microsoft’s text unchanged. Dates from the gallery’s upload records.