Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
For your extension to run properly, configuration and starting data such as permission sets and table data may be needed. An extension can include the following types of data that can be imported for the tenant during the installation of the extension.
- Permission sets
- Web services
- Starting table data
- Custom report layouts
The data must be exported into files to be included in the extension. To use the export functions, you must use a container sandbox environment for Business Central. Learn more in Get started with the container sandbox development environment.
To add permission sets
Open the Business Central Development Shell.
Export the relevant permission set using the
Export-NAVAppPermissionSetcmdlet to export the permission set to a file. For example, the following command exports the BASIC permission set.Export-NAVAppPermissionSet -ServerInstance DynamicsNAV160 -Path '.\PermissionSet.xml' -PermissionSetId BASICNote
Export each permission set to a separate XML file.
Add the exported permission set files to the Visual Studio Code project that contains your extension.
Warning
If you don't include a permission set with your extension, only users with the SUPER permission set will be able to use the extension.
Important
With the latest version of Business Central permissions are no longer defined as data in the application database. Permissions that can be created by using AL objects are called system permissions. Learn more in Entitlements and permission sets overview.
To add web services
Open the Business Central Development Shell.
Export the relevant web service using the
Export-NAVAppTenantWebServicecmdlet to export the web service to a file. The following command exports the Customer Card page.Export-NAVAppTenantWebService -ServerInstance DynamicsNAV160 -Path TenantWebService.xml -ServiceName Customer -ObjectType Page -ObjectId 21Note
Export each web service to a separate XML file.
Add the exported web services files to the Visual Studio Code project that contains your extension. An exported web service XML file looks like the following:
<?xml version="1.0" encoding="utf-8"?> <ExportedData> <TenantWebServiceCollection> <TenantWebService> <ObjectType>Page</ObjectType> <ObjectID>21</ObjectID> <ServiceName>Customer</ServiceName> <Published>true</Published> </TenantWebService> </TenantWebServiceCollection> </ExportedData>You may also merge multiple XML files into one:
<?xml version="1.0" encoding="utf-8"?> <ExportedData> <TenantWebServiceCollection> <TenantWebService> <ObjectType>Page</ObjectType> <ObjectID>21</ObjectID> <ServiceName>Customer</ServiceName> <Published>true</Published> </TenantWebService> <TenantWebService> <ObjectType>Page</ObjectType> <ObjectID>26</ObjectID> <ServiceName>Vendor</ServiceName> <Published>true</Published> </TenantWebService> </TenantWebServiceCollection> </ExportedData>
To add table data
Open the Business Central Development Shell.
Export the relevant data using the
Export-NAVAppTableDatacmdlet to export the data to a file. This includes setting the path to a folder where you want the .navxdata file created. A data file in the format ofTAB<TABLEID>.navxdatawill be created. (Example: TAB10000.navxdata).Export-NAVAppTableData -ServerInstance DynamicsNAV160 -Path 'C:\NAVAppTableData' -TableId 10000Note
Export the data for each table to a separate XML file.
Add the exported table data files to the Visual Studio Code project that contains your extension.
Call the procedure in a Codeunit with the Subtype property
InstallorUpgradeand specify the table ID in theNavApp.LoadPackageDataprocedure as shown in the following example.codeunit 50100 MyExtensionUpgrade { Subtype = Upgrade; trigger OnUpgradePerDatabase() begin NavApp.LoadPackageData(50100); end; }Warning
An extension can only include table data for new tables that are added as part of the extension.
To add custom report layouts
Open the Business Central Development Shell.
Export the relevant report layouts using the
Export-NAVAppReportLayoutcmdlet to export to a file:Export-NAVAppReportLayout -ServerInstance DynamicsNAV160 -Path .\ReportLayout.xml -LayoutId 1Note
Export each custom report layout to a separate XML file.
Add the exported custom report files to the Visual Studio Code project that contains your extension.