Posts

Active Sessions in Business central and kill session

Image
Here I want to show how to check active sessions in Business central. If the business central is on the cloud, then login to the admin  center, open the environment. If the business central is on-prem, then the below power shell script can be used. View the sessions: Get-NAVServerSession -SeverInstance <Name> -Tenant <Tenant-id> Kill the session: Remove-NAVServerSession -ServerInstance <Name> -Tenant default -SessionId <Session Id> The other way to view the sessions by creating a simple extension. This can be used in both on-cloud and on-prem version of business central. Below is the code to create a page. page   60102  "Active Sessions" {     PageType =  List ;     ApplicationArea = All;     UsageCategory = Administration;     SourceTable = "Active Session";     Editable = false; ...

Next object id in VS Code

In this blog, I would like to give a simple example of how to get the next object id that can be used in the Business central extension. If you are using the Visual Studio Code for the development of extension, it is quite simple to get the next object id. Use the snippets provided by Microsoft to create an object of any type like table, page, codeunit, table extension, page extension, etc. Check the object id range that has been defined in the app.json of the extension. In my example, I have used the object range from 50100 to 50149. Click on Id and type the first digit of your defined id range. In my case, I have entered 5. The next object that can be used in the extension automatically appears on the screen. In the example, the object id 50104 appeared for table extension. It means that the extension already contains objects till 50103. Similarly, we can get the object id for other object types also.