D365 Business Central Archives - Page 8 of 32 - - Page 8

Category Archives: D365 Business Central

Reduce Storage Usage for Business Central using Data Administration

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’ve 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 from within Business Central itself. 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 click on refresh to load the latest data. You can also configure it so that the data is loaded automatically in the background every so often. Here, we get the options for Data Clean up where we can delete data that isn’t required anymore. All of the below options, open a similar processing report where you can set filters which are used to delete the records as needed. The “Delete Detached Media” opens another page which I’ve discussed in depth in another blog. The second action groups hold actions which are meant to compress the ledger entries which can drastically reduce the storage space used. It is important to note that you can only compress entries which are older than 5 years by yourself which belong to Fiscal years that are closed and the entries themselves are closed (Open is set to false). You can configure the compression such that there is one entry per day, one entry per week, one entry per month, one entry per quarter, one entry per year or one entry for the period that is defined for compression. You also have the functionality to delete empty registers from here. If these individual actions seem to be overwhelming, Microsoft also provides for a Data Administration wizard which simplifies this process and allows you to manage the capacity via a wizard. Conclusion Thus, we saw how we can use the standard data administration tools to manage capacity of Business Central environment which can help the system run much more efficiently in terms of both performance and costs. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

How to Setup Alternative Unit of Measure in Business Central

Introduction:  Many Businesses supports buying and selling items with different unit of measures. How to configure this in Business Central without showcasing your inventory in decimals. Let’s take an example: We will be buying the goods always in dozen whereas we can sell the items in PCS or CARTONS. Steps to achieve the goal: 2. Once the base unit of measure is set to PCS. Go to the Item Unit of Measure page by click on Related-> Unit of Measure. 3. By default PCS line would be set to 1. Add new line enter DOZEN and next right 6 which means 1 dozen has 6 PCS. 4. Next line add CARTONS and enter the qty per unit of measure as 72. which means 1 Cartons has 72 PCS in it. 5. Once the above lines have been set. Let’s pass Item journal where will be increase the inventory by dozen and sell the items in PCS and CARTONS. Ideally the inventory would be shown without any decimal value. 6. Below is the explanation how system would calculate into PCS as when you buy and sell in different items. 7. Purchase 100 dozen which is 600 PCS. This would be converted by Business Central itself. As we have defined 1 dozen as 6 PCS. 8. Sales 7 Cartons which is 702 PCS. This would be calculated by Business Central itself as per the Item Unit of Measure configuration where 1 cartons is 72 PCS. 9.Once the above transaction is posted the inventory would be whole value without any decimal. Conclusion:    Thus, we saw how we can use alternative Unit of measure in Business Central. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Item Availability Overview – A quick glance at the Item’s Inventory levels

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 page. Further, if you click on the “All Locations” then the “Item Availability by Location” page is opened. That’s all! Just wanted to share something new I learned recently. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Actionable Error Messages in Business Central

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 References Actionable errors Try Methods for Error Handling Robust Coding Practises Error Info – Business Central Docs Explanation Before we get to the code, let’s set a little context. For Error Handling, Microsoft has two categories in Business Central, ErrorInfo is a data type used for error handling and reporting.  It can be used to hold information about errors that occur during the execution of code. It has additional properties and actions that can be used to define it’s behavior to the end-user. The ones that are most useful as – The “Add Action” procedure takes a codeunit and a method name as input. To pass input into this procedure, we add an “ErrorInfo” object as a parameter to the function and if we want to specify some details of the record where the error is happening or where the fix is to happen, we can use the following procedures. The “Add Navigation Action” only takes a method name as an input. So, to tell the action which page and which record to open we have the following procedures. If you are passing the Page No. and System Id to the procedure which handles the error then the same can be accessed there as well. Code Here, I’ve taken a sample scenario where the value of one field depends on the value of another field on the Sales Order. Basically ;-   I’ve set it up so that these validations are triggered when the Sales Order is posted. And the same thing goes for the “Not Blank” scenario so I’m not writing it for now. So, if I try the second scenario where Type is “Blank” and Field has some value then we get the following error message. If I click on the “Copy Details” I can see the detailed message that I added for this Error Info. If I click on the “Make Mandatory Field Blank” action then I can make the “Some Important Field” as blank. The code behind the action – “Make Mandatory Field Blank” is as follows-  I’ve used messages to confirm that the values that I passed during the origin of the error are flowing into the procedure. Here are the messages –  Now, some of you might be wondering, if this was a error message where one field was dependent on another then it should’ve been a validation. And yes!  That is correct and here is how it would look. Here, I’ve used both “Add Action” and “Add Navigation Action” on the ErrorInfo. For the Parameters, all of the parameters are pointing to the Customer. This opens the Customer Card for the specified Customer. Conclusion You can refer the “Actionable Errors” documentation for the best practises and patterns for which type of actionable error to use and where to use it. Thus, we learned how to utilize actions within error messages in Business Central to assist users in resolving errors more effectively. We hope you found this article useful and if you would like to discuss anything you can reach out to us at transform@cloudfronts.com. 

Share Story :

What is “Database Wait Statistics” in Business Central?

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: 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 system tasks like deadlock detection or cleaning up deleted records.Even if there’s no immediate task, workers might still check periodically. External Waits:  This occurs when a worker is waiting for something outside the SQL Server environment to finish, like a call to an external procedure or a query to a linked server.It’s important to note that just because a worker is in external wait doesn’t mean it’s idle; it might be actively running external code. In context of Business Central, we see the following “wait” types: Buffer IO: This type of wait occurs when a database session is waiting for data to be read from or written to the buffer cache, which is an area of memory used to cache data pages from disk. Buffer Latch: Buffer latch waits happen when a session is waiting to acquire a latch on a buffer in memory. Latches are used to protect access to in-memory data structures, and buffer latch waits can occur when multiple sessions are contending for access to the same buffer. Compilation: Compilation waits occur when a session is waiting for a SQL query or stored procedure to be compiled and optimized by the database engine. CPU: CPU waits occur when a session is waiting for CPU resources to become available for query processing. Idle: Idle waits occur when a session is not actively performing any work and is waiting for something to do. Latch: Latch waits, as mentioned earlier, happen when a session is waiting to acquire a latch on a data structure in memory. Lock: Lock waits occur when a session is waiting for a lock on a resource that is held by another session. Memory: Memory waits occur when a session is waiting for memory resources to become available. This can include waits for memory allocations, deallocations, or other memory-related operations. Network IO: Network IO waits occur when a session is waiting for data to be sent or received over a network connection. Other: This category typically includes waits that don’t fit into the other specific categories listed. Other Disk IO: This is similar to Buffer IO waits but encompasses other disk-related operations beyond just buffer reads and writes. Parallelism: Parallelism waits occur when a session is waiting for other parallel threads to complete their tasks. Preemptive: Preemptive waits occur when a session is waiting for an external operation to complete, such as an operating system call. Service Broker: Service Broker waits occur when a session is waiting for a message to be sent or received via the Service Broker feature in SQL Server. SQL CLR: SQL CLR waits occur when a session is waiting for a Common Language Runtime (CLR) operation to complete. Tran Log IO: Transaction Log IO waits occur when a session is waiting for data to be read from or written to the transaction log. Transaction: Transaction waits occur when a session is waiting for a transaction to complete. User Wait: User waits are general-purpose waits that occur when a session is waiting for some user-defined event to occur. Worker Thread: Worker thread waits occur when a session is waiting for a worker thread to become available for query processing. Conclusion: Thus, we saw how we can use the “Database Wait Statistics” in Business Central to identify performance bottlenecks in the system. We hope you found this article useful and if you would like to discuss anything you can reach out to us at transform@cloudfronts.com. 

Share Story :

Use Database Access Intent List to Boost Performance in Business Central

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 transactions are directed towards the leader database which are then forwarded to the follower databases.All the read transactions can be forwarded to either the leader or the follower database. Please note that this all only happens for Production Environments. Sandbox environments only have the primary database. Side Note  If you’re wondering what happens when a User tries to read from a follower database before the leader database was able to send the updated information there (This is called a stale replica).  This is an accepted risk when using this architecture. According to CAP Theorem only two of the three properties, Consistency, Availability and Partition Tolerance can be guaranteed. Out of these, partition tolerance has to be tolerated as network failures are inevitable so most systems have to choose between Consistency and Availability. In most cases, RDBMS systems choose Consistency over Availability (as does Business Central) and most NoSQL databases choose Availability over Consistency. Pre-requisites Business Central Cloud/OnPrem References Explanation Setting the property DataAccessIntent to ReadOnly doesn’t guarantee that all the operations that a particular object does are going to be routed via the “replica database”. For example, consider a case where we are using a processing report to update a field on the Item table based on the calculations done using a Query object. Here, when the operation started, given that the processing report intents to update the Item table, the operation was forwarded into the Primary database, now when the Query is executed to fetch the generate the necessary value, the database is still going to be the Primary database. To summarize, the database is not switched in the middle of a transaction. For API Pages where we are only going to be fetching the data from Business Central, we have to set the API page’s Editable property as false and only then we can set the DataAccessIntent to ReadOnly.We don’t have this property for any other page types. For Reports, we can set the DataAccessIntent property directly and if it is a processing report that tries to make any modifications to the data then we end up with a run-time error. For Queries, we can set the DataAccessIntent property directly as well with the same conditions as the Report object but in effect, the only time queries benefit from the “replica database” is if they are used directly as APIs. Almost all the ODATA GET requests are directed to the “replica” database by default in Business Central on Cloud. In the On-Premise Environment, we have a setting “ODataReadonlyGetEnabled” that controls this behaviour. Further, there is a list page in Business Central “Data Access Intent List” which can be used to modify the Data Access List of any Page, Query or Report object. The Default Value indicates that the object should use the pre-defined value defined in AL. The same rules as above are followed when we update the “Data Access Intent” values in the Data Access Intent List page. Conclusion: Thus we saw how Business Central architecture uses the “read scale out” method to ensure consistency and availability and how we can leverage those to boost our application’s performance. Happy Coding!

Share Story :

Setting Up Business Central On-Premise (BC-230) on a Virtual Machine

Introduction: Microsoft Dynamics 365 Business Central (formerly known as Microsoft Dynamics NAV) is a comprehensive business management solution that helps organizations streamline their financials, supply chain, sales, and customer service processes. It offers robust features for managing various aspects of your business, from inventory control to financial reporting. In this blog post, we’ll focus on the steps to download and install Business Central on-premises within a virtual machine. Whether you’re a developer, IT administrator, or business user, understanding this process is essential for setting up a local environment to explore and work with Business Central. Pre-requisites: Steps: 2. Choose the region for the business central 3. Extract the downloaded file. 4. Go to the extracted file and click on setup. 5. Choose Advanced Installation Options -> Choose an Installation Option -> Custom. 6. Make all the listed components available (Run from My Computer) or (Run all from My Computer). 7. Make the necessary changes. 8. Go to Azure Portal and assign the DNS Name in Azure Portal. 9. After the successfully installation, go to Windows PowerShell ISE -> “Run as Administrator” and execute the below commands line by line. Set-ExecutionPolicy unrestricted -Force Import-Module ‘C:\Program Files\Microsoft Dynamics 365 Business Central\230\Service\NavAdminTool.ps1’; Get-NAVServerConfiguration -ServerInstance BC230 Set-NAVServerConfiguration -KeyName EnableDebugging -KeyValue true Set-NAVServerConfiguration -KeyName DeveloperServicesEnabled -KeyValue true Restart-NAVServerInstance -ServerInstance BC230 Get-NAVServerUser BC230 Set-NavServerUser -Company ‘CRONUS International Ltd.’ Note: Upon executing the New-SelfAssingedCertificate command, a Thumbprint will be generated. Please retain the thumbprint ID for your reference. New-SelfSignedCertificate -DnsName “www.shubhazure.eastus.cloudapp.azure.com” -CertStoreLocation “Cert:\LocalMachine\My” 10. After creation/installation of Certificate, Go to Manage Computer Certificates > right-click on the Certificate > All Tasks>Manage Private Keys > Add NETWORK SERVICE and allow access to all the users and copy the certificate to Enterprise Trust, Trusted People, Trusted Publisher and Trust Devices folder. 11. Go to IIS Manager in that BC230 -> click on Browse “:8080 (http)”. 12. Change Credential Type and Add Thumbprint Set-NAVServerConfiguration -KeyName ServicesCertificateThumbprint -KeyValue Set-NAVServerConfiguration -KeyName ClientServicesCredentialType -KeyValue NavUserPassword 13. Change the Credential Type in navsettings.json file: This tells Business Central Clients to change the CredentialTypes for the Client. Goto C:\inetpub\wwwroot\<WEB SERVER INSTANCE>\navsettings.json 14. Go to Users in Business Central, insert the Password: 15. Binding your Web Server Instance with SSL / Self-Signed Certificate in IIS: 16. Restart the Server Instance in Business Central Administration and Webserver instance in IIS.  Result After inserting the credentials, you will get access to Business Central. Conclusion Thus, in this blog we saw how to download Business Central (BC230) on Virtual Machine. We hope you found this article useful and if you would like to discuss anything you can reach out to us at transform@cloudfonts.com. 

Share Story :

Using Notifications in Business Central via AL

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’ll be using to show/hide the notification itself. Both of those combined result in a page like below – Now, here is the list of procedures that are available with a “Notification” variable. Let us walk through these one by one. Message – Specifies the content of the notification that appears in the UI. The message function is what we use to decide what the notification will say.  I set up a global variable (Message) on my page so the user can type in a value directly, and that value will appear in the message. Scope – Specifies the scope in which the notification appears. According to Microsoft Docs, it is meant to specify the context in which the Notification appears. However for now, we only have the “Local Scope” available as an option so can’t comment much on this. Send – Sends the notification to be displayed by the client. Send is the function used to actually trigger the Notification in the UI. It returns a boolean value indicating whether the notification was triggered successfully or not. Set Data – Sets a data property value for the notification.Get Data – Gets a data property value from the notification.Has Data – Returns a boolean value indicating whether the notification has that value. These three functions work similar to a dictionaries Get, Set or Has functions. As Notifications can be used to perform actions, we need to store some data in them. This data is stored using key value pairs using the “Set Data” function. Then later we can retrieve it back using the “Get Data” function by passing in the specific key.  However, if the Key does not exist, we get a run-time error, thus we can use the “Has Data” function to check whether our notification has the specified key. Please note that the data in the Notification is stored till the User dismisses the notification or exits from the page. Add Action – Adds an action on the notification. Here, in the “Show Notification” action, I have added the “Set Data” function to store the data within the global variable “MyData” into the notification with a key as “MyData” as well. Then, we call the “Add Action” function the following parameters In the “Notification Action” codeunit i’ve created a simple procedure which checks, gets and then messages out the value set in the “MyData” key. And so, we get the following output when we click on the action button on the notification. When we click on the action button, the notification automatically disappears. Recall – Recalls a sent notification. However, if we want to manually recall a notification, we can use the “Recall” procedure. After I click the “Hide Notification” button. Id – Gets or Sets the GUID ID for an individual notification. We can use the ID function to Get to Set the ID for a particular notification. We can use this in conjunction with the other functions by passing the ID of one notification and using that to get the data from that notification instead of passing the Notification variable itself. Here I’ve made some changes to the “Show Notification” action such that now it pops up two notifications instead of one and I am storing the ID of the second notification. This is the output. Now, here is the “Hide Notification” action which will be using the ID saved from earlier to recall just the copy notification. And this is the output. Conclusion Thus, we saw how we can use notification to provide non-intrusive alerts to the User along with actions. Happy Coding!

Share Story :

Tenant Creation and User Permissions for Business Central using Azure Portal

Introduction: Creating a tenant in Microsoft Entra-ID or Azure Active Directory (AAD) is a simple process that can be accomplished through the Azure portal. The portal serves as a centralized hub for managing Azure Active Directory and executing various administrative tasks, including the creation of a new tenant. Additionally, this blog will cover how to create a user and grant them permissions. Pre-requisites: Steps: Sign in to Azure Portal. Navigate to Microsoft Entra ID tenants: Select “Create”: Choose the type of tenant: On the Basics tab, select the type of tenant you want to create: Click Next: Configuration to proceed. Provide the necessary information: Organization name: Type your desired organization name (e.g., “Cloudfronts”). Initial domain name: Choose an initial domain name (e.g., “cfblogs”). Country/Region: Select your desired country or leave it as the United States. Review and create: Your new tenant is created: Check your user account: User can change their User Principal Name (which is generated by the system) by clicking on user e.g. “Shubham Prajapati” Now Sign in to Business Central Business Central Sign In | Microsoft Dynamics 365 Now put the User principal name As password was not set during tenant creation. Go to > Forgot Password After setting up the password you can successfully login to your Business Central Now Go to Settings > Admin Center Now Click on Upper Left Corner > Admin Go to Active Users > Click on the user which you want to give permission to access central, then go to Licenses and apps and select Licenses > Save changes Once permission is provided Go to Users page in business central and click on Update users from Microsoft Now the user is being updated, to give environment permission click on the user whom you want to give permission To give environment permission to user click on New Line > Select appropriate permission to user Conclusion Thus, in this blog we saw how to create a tenant for business central and how to add users and give permissions to them. Thank you for reading hope this helps!

Share Story :

Transfer Environment in Business Central

Introduction: The Transfer Environment feature in Microsoft Dynamics 365 Business Central allows you to seamlessly move an environment from one Microsoft Entra tenant to another. Here are the key points: Purpose: Self-Service Process: Steps: This streamlined process enhances flexibility and efficiency for managing Business Central environments across different tenants. Pre-requisites: Steps: 2. We are going to transfer “Shubham” to different tenant. Click on “Environment Transfers” 3. Go to Transfer Environment. 4. Select the environment that you are going to transfer and enter the Destination Tenant id. It is also possible to schedule the transfer within 2 weeks and set the time when it should be transferred. 5. Now go to Destination Environment > Admin Center. 6. Click on Environment Transfer > Receive Environment. 7. Enter the Source Tenant id (source from where the environment is to be send). Click on Next. 8. After that in Pending Incoming transfers the Environment will be displayed. Now just click on the Environment and Confirm. 9. The Environment is being successfully transferred. Note: If the destination tenant already has 1 Production environment and 3 Sandboxes, environment transfer is not possible. For successful transfer, the destination tenant must have no existing production environments (if you are transferring a production environment) or fewer than 3 sandboxes (if you are transferring sandbox). Conclusion: In conclusion, this blog has provided valuable insights about how to transfer environment in business central. Thank you very much for reading. I hope this helps!

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange