Posts

Showing posts from May, 2023

Automated Detached Media Cleanup

Image
Introduction In Business Central, there are two ways to store files. Either as Blobs or as Media types. In Media types, we store the files in the database (Tenant Media ID - 2000000184) and then we refer this record in other tables. Whenever there are no records referring a Media, it is deleted from the database. Media types are much more performant as they support caching whereas BLOBs needs to be fetched from the SQL Server every time they are used. Microsoft has moved most of the fields from using Blobs to Media types. However, in scenarios with a high load of writes and deletes, it is possible that there may end up orphaned media records i.e. Media records that are not referenced anywhere. In order to tackle such cases, Microsoft has recently announced the FindOrphans procedure which would return a list of GUIDs of such orphaned Media Types which could then we dealt with as needed. There’s also another tool that has been provided by Microsoft which uses this newly added procedures

Reduce Storage Usage Using Data Administration in Business Central

Image
Introduction By default, Business Central comes with 80GB of storage capacity across three sandbox environments and 1 Production Environment with an additional 3GB/Premium License, 2GB/Essential License, 1GB/Device license. These storage limits depending on your business volume may run out if the data is not managed properly. Business Central now comes with a one stop view where you can manage (compress or delete) the entries to reduce storage usage - “Data Administration.” Pre-requisites Business Central Cloud/On Prem References Manage Storage by Deleting Documents or Compressing Data - Business Central | Microsoft Learn Configuration In Business Central, we have had the option to view the capacity usage from the Admin Center for a while now. Recently, they’ve also added a one stop view to check and manage the capacity usage - Data Administration. It can be found directly from the global search. The first time we open this we are greeted with an empty view, the data is loaded after we

Attach Debugger to an Active Session

Image
Introduction Business Central has recently introduced the functionality to attach a debugger to an active User session. This was previously available in NAV however it has only recently become available for Business Central. Pre-requisites Business Central OnCloud/OnPrem References Attach AL Debugger - MS Docs Configuration To use this functionality, we simply need to create an entry in the launch.json file. The important properties here are the “sessionId” and the “request”. This works much faster than the traditional deploy and debug and really makes your life easier as a developer.   Also, I tried using it for a Production Environment and as expected it didn’t work. Snapshot debugging it is then! Conclusion Thus, we saw how we can attach a debugger to an active user session in Business Central.  Happy Coding!

Master Data Sync Across Companies

Image
Introduction In many business scenarios we have two or more companies which work with the same Customers or Vendors or has same data that is to be shared with multiple legal entities. For such cases, manually making sure everything is in sync becomes difficult as the number of entities increases. For this, Business Central now comes with the functionality to sync master data across multiple companies. This can also be used by consultants for one time syncs if they simply need the setups from one company in another instead of going through the Configuration Package route. Pre-requisites Business Central Cloud/OnPrem References Set up and sync master data across companies Set Up Companies to Synchronize Master Data - Business Central Configuration First, I’ve created two companies in a Sandbox Box which are going to have a uni-directional sync between them. It is possible to have a bi-directional sync however it may cause issues and may cause over-write of data if it isn’t configured pro