Posts

Showing posts from 2024

Configure Gmail SMTP service in Business Central without "Allow Less Secure" setting

Image
 Introduction Business Central has great email features like sending email, editing it with Rich Text, adding attachments, etc, but to send emails, you'll need to connect it with services like Outlook or Gmail. There is no outlook side configuration that is to be done if you are using Microsoft Outlook however if you are using Google's Gmail then there's a litte change that has happened on the configuration end. Starting May, 2022, Google has removed the "Allow Less Secure Apps" settings from the Google Accounts, which was essential is using Gmail to send emails from Business Central. However, to replace that we have "App Passwords" which we can use instead. Also, just something to keep in mind, Google is going to remove this from the "Google Workspace" accounts as well by Sept, 2024 so it would be wise for you to migrate your configurations to use app passwords. Reference 1.  How to Setup Email in Business Central 2.  Google Support - Less sec

Item Availability Overview - A quick glance at the Item's Inventory levels

Image
While going through some sales documents, I noticed that the page that appears when I click on "Show Details" in the notification for low inventory has been updated! When we click on "Show Details" now, we're taken to the page named "Item Availability Check". Furthermore, it includes options to directly create a Purchase Order or a Purchase Invoice from this page.  If a Vendor is specified in the "Vendor No." field of the Item Card, the Purchase Order/Invoice is automatically generated with that Vendor. In the scenario where multiple vendors are selected in the Item Vendor Catalog instead of the Vendor No., all the vendors are displayed, and the one selected by the user is utilized to create the Purchase Order/Invoice. In both cases, the Purchase Line will reflect the shortfall as the Quantity. If the Item has any substitutes available then the "Substitute Exists" indicates the same and clicking on it opens the Item Substitutions pa

Actionable Error Messages in Business Central

Image
Introduction Error handling is an important concept in every technical field.  It helps programs deal with unexpected problems and mistakes smoothly.  It makes sure software works reliably and doesn't crash unexpectedly.  Error handling also helps developers find and fix issues quickly, making the software better for users. Plus, it gives users clear messages when something goes wrong, making their experience smoother. It shows that the team has considered the scenario and has measures in place for it indicating a well designed solution. Microsoft has an amazing document which lists the things to keep in mind for writing resilient code. In Business Central, we have try functions to handle errors and error function to show those errors to the Users.  In this blog, we'll learn how we can enhance the error messages so that the Users can resolve the errors themselves or at the very least we can point them towards where the error is. Pre-requisites Business Central OnPrem/Cloud Refe

Use Database Access Intent List to Boost Performance in Business Central

Image
Introduction For any Business Application, database replication is a necessity for the application to be highly available, fault tolerant and performant without any data throughput issues. Business Central too follows the database replication utilizing a technique known as "Read Scale Out" or "Leader/Follower or Master/Slave Replication Architecture". Basically, the business operations(Codeunits, Pages, POST/PUT/DELETE API calls) which create the data in the system are relatively quick as compared to Analytical operations (Reports, Queries, GET APIs calls)which read a whole bunch of data from a lot of tables at once. So, in this case, performing both business and analytical operations on the same database can cause performance issues as tables can be locked by an analytical operation while a business operation tries or access or modify that data. A solution for this is using multiple copies of the database in a leader follower architecture. All the write transaction

What is "Database Wait Statistics" in Business Central?

Image
 Introduction: “Wait” typically refers to the amount of time during which a database session waits for an event to complete before it can proceed with execution. Waits can arise for many reasons in a database system, and understanding them is important for  tuning and optimizing performance. References: Database Wait Statistics - Microsoft Docs SQL Server, Wait Statistics object sys.query_store_wait_stats (Transact-SQL) sys.dm_db_wait_stats (Azure SQL Database) sys.dm_os_wait_stats (Transact-SQL) Explanation: Waits, in SQL, are broadly categorized into three categories: Resource Waits : These happen when a worker needs access to a resource like data or system resources, but it's not available because another worker is using it. Examples include waiting for locks, system latches, or for data to be read from the network or disk. Queue Waits :  Occur when a worker is waiting for a task to be assigned to it. Think of it like waiting in line for a job to do. This commonly occurs with sy

Using Notifications in Business Central via AL

Image
Introduction Notifications in Business Central are alerts that appears in the Notification bar based on User actions. Notifications stack up from top to bottom, lasting until the user dismisses them, including those from sub-pages.  Validation errors are prioritized and shown before other notifications. We can use this to alert the user regarding something without taking all the user's notification towards it, in the way messages or errors do. They also have the option to allow Users to make a corrective action by embedding the action button directly into the notification. Let's see how it works. Source Code Pre-requisites Business Central OnPrem/Cloud. References Notification - Business Central Docs Configuration Here, for an example, I've created one simple page which takes two inputs. 1. The message that is to be shown in the notification. 2. The message to be shown after the User clicks on the action embedded in the notification.     And I have two actions which I'l