Sample Extension v2.0 - Dynamics NAV / AL extension / SaaS - ALF Export Setup Tabs to Excel
In this blog post I will try to show an example of creating an extension v2.0 (AL extension).
This is will be the extension for Dynamics 365 for Finance and Operations, Business edition system (Cloud NAV), in other words: the app for SaaS environment.
A good start point for an extension story: Getting Started with AL
For the questions and searches you could use GitHub page: https://github.com/Microsoft/AL/issues
In my scenario I firstly create an object via classic way (Object Designer, on-prem version) and after that convert this object to AL object with use The Txt2Al Conversion Tool.
GitHub project: https://github.com/finn777/ALF-Export-Setup-Tabs-to-Excel
- Cloud sandbox (microsoft-sandbox):
Remember that you not one in this sandbox. // In general, you could see that Users page shows more than one line.
BUT if you need you always can do Reset Sandbox and start from a clean environment.
We are trying to create Excel file via one click and add some improvements: all data on the one sheet, add some additional info and etc..
For the Excel export purpose I am going to use the functions from Table Excel Buffer (370).
I use report with no data item and with ProcessingOnly=Yes; UseRequestPage=No
Why I use a report? Because you could add Pages and Reports to Search in Cloud system. // Adding Pages and Reports to Search
During building an object that are going to be run under Cloud (SaaS) remember that not all functions / objects could be used in extension v2.0 (AL extension).
You should use function that has Property FunctionVisibility = External // Question: FunctionVisibility
Most virtual/system tables are currently not allowed for usage in AL extension. // Remember Modern DEV (AL) story is very fresh and change / improvement every month
I like this sentence from the on-line help (Testing your Extension):
Always test in a true Dynamics 365 for Finance and Operations, Business edition SaaS environment. If you test in on-prem, you might miss errors that would be seen on SaaS. My object ALF Export Setup Tabs to Excel (Original_on-prem).txt
Now let’s use The Txt2Al Conversion Tool
cd C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client finsql.exe Command=ExportToNewSyntax, File="C:\Users\alexef\Documents\ALF Export Setup Tabs to Excel\Convert_Objects\Objects_on-prem_NewSyntax_NEW\ALF Export Setup Tabs to Excel.txt", Database="Demo Database NAV (11-0)", ServerName="RU-ALEXEF07\NAV2018", Filter=Type=report;ID=50126 txt2al.exe --source="C:\Users\alexef\Documents\ALF Export Setup Tabs to Excel\Convert_Objects\Objects_on-prem_NewSyntax_NEW" --target="C:\Users\alexef\Documents\ALF Export Setup Tabs to Excel\Convert_Objects\Objects_AL" --rename --type=Report --extensionStartId=70050126
Rename object according Best Practices for AL
Run ‘Visual Studio Code’:
Set “publisher” (!):
Now try to run object directly:
For you own Cloud sandbox you could use link:
Dynamics 365 for Finance and Operations, Business edition Sandbox tenant
You should set launch.json:
AL: Clear credentials cache
Sign with e-mail that has been set during creation sandbox:
Now you can run AL: Publish … and later run report in system:
Additional info 2:
If you use https://aka.ms/bcsandbox to create your Business Central Sandbox Container Azure VM then set