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 :
How to create Virtual Machine on Azure Portal?
Introduction: A virtual machine (VM) is like a computer within a computer. It’s software that emulates a physical computer, allowing you to run multiple operating systems and applications on a single physical machine. VMs are useful for testing software, running different operating systems simultaneously, isolating applications, and consolidating hardware resources. They provide flexibility, scalability, and cost savings by reducing the need for physical hardware and allowing for more efficient resource utilization. Pre-requisites: Configuration: To create a Virtual Machine using Azure Portal Go to Azure Portal and sign in with your credentials. Once you are signed in, you will see the Azure Portal dashboard. This dashboard is customizable and can be tailored to your needs. To create a new resource, click on the Create a resource button on the left-hand side of the dashboard. You will be taken to this page where you can select the type of resource you want to create. Choose the appropriate resource type and follow the prompts to create it. To create a Virtual Machine, select that and enter required credentials. After the deployment is complete click on “Go to resource”. Click on Connect and download the RDP File. Now the Virtual Machine is created. To start the Virtual Machine, Click on Select > Start VM Then go to downloads and click on the downloaded RDP File > Connect. Enter the password which you had entered while the creation of Virtual Machine. Conclusion Thus, in this blog we saw how to create virtual machine and how to setup Business Central on Virtual Machine. Thank you!
Share Story :
Enabling Physical Negative Inventory in Dynamics 365 Finance and Operations
In inventory management, there often arises a need for flexibility, especially when dealing with orders that exceed current stock levels. Dynamics 365 Finance and Operations offers a solution to this challenge through enabling physical negative inventory. This functionality allows organizations to create sales orders even when inventory levels are insufficient, catering to scenarios where a stock may be incoming or when manufacturing units are involved. Purpose of Physical Negative Inventory: Some organizations encounter situations where they must fulfil customer orders despite lacking sufficient inventory on hand. This could be due to various reasons such as pending stock arrivals or the need to initiate manufacturing processes upon order placement. Enabling physical negative inventory facilitates the creation of sales orders under such circumstances, ensuring business continuity and customer satisfaction. Process to Enable Negative Inventory: Enabling physical negative inventory involves configuring settings within Dynamics 365 Finance and Operations. This can be achieved through the following steps: Navigate to Inventory Management > Setup > Inventory > Item Model Group. Within the Item Model Group, allow for physical negative inventory. For further insights into this process, refer to our previous blog post on https://www.cloudfronts.com/blog/d365-enterprise/d365-finance-operations/physical-negative-inventory-dynamics-365-operations/ can provide additional guidance. Necessary Steps to Manage Physical Negative Inventory: Once physical negative inventory is enabled, it’s essential to adopt proper procedures for its management to maintain accuracy and efficiency. • Ensure Availability of Physical Inventory during Shipment: Before shipping any items, verify the presence of physical inventory in stock. Only proceed with the shipment if the required items are physically available. • Transfer Stock if Necessary: If the required stock is not available at the shipping warehouse but exists in the main warehouse, initiate a transfer process to move the items accordingly and receive that in a shipping warehouse. • Periodic Inventory Closing: Implement regular inventory closing procedures to ensure accurate inventory valuations. Issues Faced by Organizations if Proper Procedures Are Not Followed: Failure to comply with the proper procedures can lead to various issues, including: Invalid Cost Value of Items: This can result in an inaccurate inventory valuation, subsequently affecting main accounts and profit estimation. In conclusion, by following these steps, organizations can effectively manage physical negative inventory within Dynamics 365 Finance and Operations, ensuring smooth operations and accurate inventory valuations. 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 :
Advance warehouse management – Warehouses and Locations in Microsoft D365 F&O – Part 2
Hello everyone, in this series of Blog, we are going to learn about the Advance warehouse management in D365. In this blog we will learn about the basic setups required for the Advanced Warehouse Management process. These setups may vary depending on the business scenarios. For a Warehouse to work in an Advance warehouse scenario, there are some prerequisites that we need to do first. The following are the setups that we need to configure: Path: Inventory Management Inventory Breakdown Warehouses. Click on New. Enter the warehouse and Warehouse name. Most importantly, for warehouse to work in a advanced warehouse scenario, we have to enable the “Use warehouse management processes”. For advanced warehouse management, the location plays an important role for better inventory visibility and item tracking. For this, we need to do multiple setups as per below. In the location type, I have mentioned four main locations. These are Baydoor, Floor, receiving and User. These locations will increase or decrease as per business scenarios. Recv: This location I am using primarily for entry of the goods/items in the warehouse. Floor: This location I am using for storing the goods/items in the warehouse. Baydoor: This location I am using for exit of the goods/items from the warehouse. User: This location I am using for default. This user location will be used in the Warehouse management parameter, in User Location profile. Location formats are used as the naming system by which we can create the unique and consistent names for different locations within the warehouse. Here, I have mentioned the length as 1. The location profiles will be used for connection between location type, Location formats and the locations. The location profiles are very important setup because the location capacity can be mentioned here. Also, how the inventory is stored in the location, and how the inventory is getting accessed is also dependent on the location profiles. Here, I have enabled User license plate tracking, allow mixed items, Allow mixed inventory statuses, Allow mixed inventory batches. Click New. Select warehouse from the drop-down menu. Enter location name as per requirement. Select the Location profile ID from the drop-down menu. We can add as many locations as we want. Now, the warehouse and locations are ready to use in Advance Warehouse process. That’s it for this blog!! How to use these warehouses and locations in actual transaction will be discussed going forward in the blog series. Keep learning!!!!!
Share Story :
Advance warehouse management – Item Creation process in Microsoft D365 F&O – Part 1
Hello everyone, in this series of Blog, we are going to learn about the Advance warehouse management in D365. What is Advance Warehousing Process? The day-to-day transactions in the advanced warehouse are a bit different than in a normal warehouse. Workers in the advanced warehouse use mobile devices to move stock from one location to another. Here location doesn’t mean just the location, we can move it from one warehouse to another. So, instead of sitting in one place, workers can move around the warehouse to pick up or put the stock. In Advance warehouse management, the visibility of the stock is very clear. Workers can see where the stock is in the warehouse and in what quantity. This results in Streamlined warehouse operations, reduced inventory carrying costs, and thus improvement in customer satisfaction through faster and more accurate order fulfillment. In this blog we will learn about the basic setups required for the Advanced Warehouse Management process. These setups may vary depending on the business scenarios. For an item to work in an Advance warehouse scenario, there are some prerequisites that we need to do first. The following are the setups that we need to configure: Path: Product Information Managementà Dimension and Variant Groupsà Storage Dimension Groups. In the Storage dimension group, activate the “Use warehouse management process.” Once you activate the use warehouse management process, the Location, Inventory Status, License Plate will be automatically activated. 2. Reservation hierarchy Path: Warehouse Management à Setupà Inventoryà Reservation Hierarchy. A reservation hierarchy helps delay specific reservation details until after you’ve placed an order. This hierarchy relies on item-related factors like inventory status and license plate for storage and tracking. While it’s essential to have site, warehouse, and inventory status information during the ordering process, certain details like location can be added after making reservations. For instance, the warehouse management system can identify the best locations for picking based on this reservation hierarchy. 3. Unit sequence groups Path: Warehouse Management à Setup à Warehouse à Unit sequence groups. Unit sequence group is mandatory setup which works when dealing with movement of material. Now take one example: If the Unit sequence group is mentioned as Each and Box, then While making product receipt from a Purchase Order, mobile device will show the options to receive the materials in two different units which are Each and Box. Here based on my scenario, I have mentioned the default unit for Purchase orders and Transfer Order as Box. Now, the Item is ready to use in Advance Warehouse process. That’s it for this blog!! How to use this item in actual transaction will be discussed going forward in the blog series. Keep learning!!!!! Next in the Blog series: How to create Warehouses in Advance warehouse management in D365. How to create Locations in Advance warehouse management in D365.
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 :
Configure an Azure Connector in LCS
Introduction In this blog, we’ll be looking into configuring the Azure Connector in LCS with the Azure Resource Manager so that LCS can deploy your resources to Azure. Pre-requisites An Azure subscription that you are a co-administrator in. References Configuration Go to Microsoft Dynamics Lifecycle Services and log in with your account. In LCS, when we try to create a cloud hosted environment for the first time, it prompts us to create an Azure Connector first. You can also access this by going to your Project Settings and the “Azure Connectors.” Once, we reach this screen, we have to click on Authorize in the organization where we want to authorize. Please do ensure your account has the necessary permissions for these actions. Once, this is done click on Microsoft Azure Portal as there are a few configurations we need to do in the Azure Portal. Click on Subscriptions. From the Subscriptions list, we can note down the Subscription ID as we will need it while creating the Azure Connector. The “Subscription ID” is also available in the Overview section of the Subscription. Then go to the Access Control (IAM) tab and click on Add and then Add Role Assignment. Then go to Role -> Privileged Administrator Roles and then search for “Contributor”. Click on it and then click on Next. In the members tab, click on User, group or Service Principal and click on Select Members. After that search for and add “Dynamics Deployment Services [wsfed-enabled]” and your own user to this role assignment. Once that is done, we’ll get a confirmation message. After that, we can move back to the LCS for configuring the Azure Connector. We click on Add to create a new Azure Connector and get the following pop-up. Here we add a name for the connector, Azure Subscription ID and the Domain Name. Name can be anything that you want, the Domain Name in most cases is the part of your email address after the @. For e.g. it’d be “microsoft.com” in case of rbansode@microsoft.com. For the Azure Subscription ID, we have already stored that from the previous steps. Once we add the necessary values and click on next we get the following pop-up. We’ve already completed the necessary steps in the Azure Portal so we can simply click on Next. After that, we get the following pop-up. We’ve completed the steps mentioned in the Ensure you are a subscription user section. If for some reason you are facing any difficulties in that you can also try the steps from the Apply a Subscription Tag section. Apply a subscription tag When you click on Get a Code you’ll get the following pop-up which includes a unique verification code. We copy this and head on to the Azure Portal. Then go to your subscription in Azure Portal. Head to the Tags section and create a new entry with name as “LifecycleServicesAuthCode” and the value as unique verification code from LCS. If neither of those methods work, there is a soon to be deprecated method mentioned as well where you upload the certificate downloaded from LCS into the “Management Certificates” of your Azure Subscription. Hopefully, one of these three methods work out for you and you’ll get the following pop-up. Once you click on connect you’ll see an entry created in your Azure Connectors. This indicates that your Azure Account has been linked and now LCS can utilize it to create resources in Azure on your behalf. Side Note If you see the following error message then that means there was an error with one of the three suggested approaches you choose. You can try with another approach and start over. Conclusion Thus, we saw how to configure the Azure Connector in LCS. Happy Coding!