Improved Visual Studio Code AL experience
Creating extensions is the way to customize Business Central. The October '18 release adds productivity enhancements to the development experience as well as support for additional extension scenarios.
With the enhancements to the tooling and extension capabilities, developers can be more productive when developing and troubleshooting solutions, and will have more options to meet customers' customization requirements using extensions.
Cloud sandbox with production data
A common scenario when working with cloud sandboxes, especially when testing or troubleshooting, is the wish to have production data available. With this release, we add the ability to create a cloud sandbox based on a copy of the latest cloud backup of the production data. To minimize cross-talk with integrations set up in the production data, these integrations will be disabled when the sandbox is created. Using caution, admin users can enable or reconfigure these integrations as required to support the intended cloud sandbox use.
A core aspect of creating extensions is to subscribe to events. However, a common challenge is understanding which events are available in a given user flow. Debugging can help, but will only show events already being subscribed to. To aid in the discoverability of events and extension points, there is a new event tracer in the client. With this, a user flow can be recorded to list events that are raised, and the developer can have subscriber code for the event generated for easy copy into AL code.
Furthermore, a large number of new events has been added, making it possible to extend in more places.
Visual Studio Code AL Extension enhancements
With versioning check and backward compatibility, you can now install the AL Language extension from the Visual Studio Code marketplace and use it to develop solutions for many different platforms, including cloud sandboxes, Business Central April 2018 release, Business Central October 2018 release, and future versions. The compiler will check that the connected tenant is compatible, and compile against the target platform as set in the new app.json property.
Also, the AL extension is now faster and more responsive when working with larger projects containing many object extensions/files.
Just like in the legacy Dynamics NAV debugger, you can now use the common Break on Error, as well as Break on Write. You can also go to definition in the base application code and set breakpoints there.
All properties in AL, both on hover and in IntelliSense, now have Help links that redirect you to the related online documentation. Furthermore, the documentation for AL language constructs is autogenerated and used for both online reference documentation and IntelliSense, ensuring up-to-date and aligned documentation.
Suggestions for Image properties in an extension now only propose the ones that can be used in the current context, displaying a warning for images that cannot be used in the current context, and you can preview images when using IntelliSense and on-hover.
Working with permissions
To make working with permissions easier, it is now possible to export permission sets from the application, using the client, and import these into the Visual Studio Code AL Extension. New permission files for the objects in an extension can also be generated from within the Visual Studio Code AL project.
When working with Business Central solutions that target on-premises deployments, you can now add .NET Interop in AL code. Note that this implies that the solution cannot be moved to the cloud later without replacing the .NET Interop.
New contextual information that describes which object and element a given string applies to has been added to the generated XLIFF translation files. This helps translators get a better overview of where a string is displayed in the UI, thereby increasing the quality of the translation.
OData-bound actions in AL
It is now possible to declare OData bound actions in AL. A new attribute and a new AL type have been introduced to achieve this.
[ServiceEnabled] procedure CreateCustomerCopy(var actionContext : WebServiceActionContext) var createdCustomerGuid : Guid; customer : Record Customer; begin actionContext.SetObjectType(ObjectType::Page); actionContext.SetObjectId(Pages::Customer); actionContext.AddEntityKey(customer.fieldNo(Id), createdCustomerGuid); actionContext.SetResultCode(WebServiceActionResultCode::Created); end;
Tell us what you think
Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the Business Central forum at https://aka.ms/businesscentralideas.