{"id":17925,"date":"2018-06-06T11:45:12","date_gmt":"2018-06-06T09:45:12","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/nav\/?p=17925"},"modified":"2023-05-31T15:27:07","modified_gmt":"2023-05-31T22:27:07","slug":"navapplicationareahelper","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/it-professional\/2018\/06\/06\/navapplicationareahelper\/","title":{"rendered":"Change multiple Application Area tags with PowerShell"},"content":{"rendered":"
Visibility of the controls in Business Central can be\u00a0regulated by the ApplicationArea property. For more information, see (https:\/\/docs.microsoft.com\/en-us\/dynamics-nav\/applicationarea-property<\/a>).<\/p>\n Before you\u00a0convert an\u00a0existing Dynamics NAV solution\u00a0to an extension written in AL, the ApplicationArea property must be set on all your\u00a0custom controls. Otherwise, they will not be visible.<\/p>\n Setting\u00a0the ApplicationArea property one by one is a tedious task that can be partially automated with the following PowerShell scripts:<\/p>\n See attached zip file, which contains the NavApplicationAreaHelper.psm1 PowerShell module: NavApplicationAreaHelper<\/a><\/p>\n Extracts data about controls that have the ApplicationArea property into a CSV file.<\/p>\n -Path <string>\u00a0<\/strong><\/p>\n Specifies the path to the folder,where NAV object\u00a0files in TXT format are placed. By default, it is the current folder.<\/p>\n -Filter <string>\u00a0<\/strong><\/p>\n Specifies the mask for filtering files of certain type. By default, it is ‘*.txt’.<\/p>\n -ToFileName <string>\u00a0<\/strong><\/p>\n Specifies the name of the CSV file. By default, it is ControlsWithAppArea.csv.<\/p>\n Reads the CSV file with modified controls and modifies the ApplicationArea property line in TXT objects accordingly.<\/p>\n \u00a0<\/strong>-Path <string>\u00a0<\/strong><\/p>\n Specifies the path to the folder, where NAV object\u00a0files in TXT format are placed. By default, it is the current folder.<\/p>\n -FromFileName <string>\u00a0<\/strong><\/p>\n Specifies the name of the CSV file. By default, it is ControlsWithAppArea.csv.<\/p>\n 1. Run the PowerShell window and navigate to the folder where TXT objects are placed.<\/p>\n 2. Type Out-ApplicationAreaData -Filter PAG99000*<\/em>. This command creates the ControlsWithAppArea.csv file where all controls on pages starting from 99000 will be stored.<\/p>\n\n
Out-ApplicationAreaData<\/strong><\/h2>\n
Parameters<\/h3>\n
Update-ApplicationAreaData<\/strong><\/h2>\n
Parameters<\/h3>\n
Procedure\u00a0<\/strong><\/h2>\n