How to: Export Data for an Extension

Note

Extensions v1.0 are no longer supported. The text in the article applies to extensions v1.0. For information about writing extensions in AL, see the table below.

For information about See
Getting started writing extensions using the AL Language. Getting Started
Converting extensions. Converting Extensions V1 to Extensions V2
Writing extension install code for when an extension is installed for the first time, or for when an uninstalled extension is reinstalled. Writing Extension Install Code
Making a newer version of an extension available. Upgrading Extensions V2
Publishing, synchronizing, and installing the extension on the tenant. Publishing and Installing an Extension v2.0

An extension package may include required configuration and starting data for your extension to run properly. 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 from Dynamics NAV into files to be included in the extension package.

To export permission sets

  1. Open the Microsoft Dynamics NAV Development Shell.

  2. Export the relevant permission set using the Export-NAVAppPermissionSet cmdlet to export the permission set to a file:

    Export-NAVAppPermissionSet -ServerInstance DynamicsNAVServer -Path '.\PermissionSet.xml' -PermissionSetId PSA-VIEW

    Note

    Export each permission set to a separate XML file.

  3. Copy the exported permission set files into a folder for packaging, such as a PermissionSets folder at the same level at the next to the DELTA folder.

    Warning

    If you do not include a permission set with your extension, only users with the SUPER permission set will be able to use the extension.

To export web services

  1. Open the Microsoft Dynamics NAV Development Shell.

  2. Export the relevant web service using the Export-NAVAppTenantWebService cmdlet to export the web service to a file:

    Export-NAVAppTenantWebService -ServerInstance DynamicsNAVServer -Path TenantWebService.xml -ServiceName Customer -ObjectType Page -ObjectId 21

    Note

    Export each web service to a separate XML file.

  3. Copy the exported web service files into a source folder for packaging, such as a WebServices folder at the same level at the next to the DELTA folder.

To export table data

  1. Open the Microsoft Dynamics NAV Development Shell.

  2. Export the relevant data using the Export-NAVAppTableData cmdlet 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 of TAB <TABLEID>.navxdata will be created. (Example: TAB10000.navxdata)

    Export-NAVAppTableData -ServerInstance DynamicsNAVServer -Path 'C:\NAVAppTableData' -TableId 10000

    Note

    Export the data for each table to a separate XML file.

  3. Copy the exported files into a source folder for packaging, such as a TableData folder at the same level at the next to the DELTA folder.

    Warning

    An extension can only include table data for new tables that are added as part of the extension.

To export custom report layouts

  1. Open the Microsoft Dynamics NAV Development Shell.

  2. Export the relevant report layouts using the Export-NAVAppReportLayout cmdlet to export to a file:

    Export-NAVAppReportLayout -ServerInstance DynamicsNAV -Path .\ReportLayout.xml -LayoutId 1

    Note

    Export each custom report layout to a separate XML file.

  3. Copy the exported files into a source folder for packaging, such as a ReportLayouts folder at the same level at the next to the DELTA folder.

See Also

Getting Started