Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 6

Recurring Sales in Business Central

Introduction: In this blog, we’ll be looking at how to reduce manual work in creating Sales Line in Business Central. For this, we’ll be using the Out of the Box feature of “Recurring Sales Lines” References: Standard Recurring Sales and Purchase Lines – Business Central | Microsoft Docs Configuration: Search for Recurring Sales Lines in Business Central global search and then click on New. Enter a Code for Identification, a short description and the Currency Code, if applicable. In the Lines, enter the Sales Line which are to be re-created. You can also define a Quantity if you want, it can be easily over-written if necessary. Go to the Customer Card for whom the Recurring Sales Line we created is going to be applicable. Then Go to Related > Sales > Recurring Sales Lines. Set the Code of the Recurring Sales Line, we just created and set the Valid From and Valid to Dates. The Insert Rec. Lines have the following options: Manual – System allows you to add the lines as and when required. Using the “Get Recurring Sales Lines” action. Automatic – System adds the recurring lines automatically whenever the Document is created. Always Ask – System shows a notification above which allows you to fetch the Recurring Lines in one click. Conclusion: Thus, we saw how to configure Recurring Sales Lines in Business Central which is a very useful tool in reducing manual work.

Share Story :

How Caching Works in Business Central

References: Data Access – Business Central | Microsoft Docs Database.SelectLatestVersion Method – Business Central | Microsoft Docs Explanation: Caching is one of the methods which systems use to improve performance and respond to requests rapidly. In a Business Central system, caching is done at two levels: Business Central Server Instance Data Cache SQL Server Data Cache. Whenever a User requests data from Business Central, it firsts check whether The data is available in the Server Instance’s cache, If not, then it checks the SQL Server Data Cache, And if not here then it fetches the data from the database. The Business Central Server Instance’s Cache is accessible to all the Users connected to that Server Instance. There are two types of cache stored here, Global Cache Private Cache Global cache is the one which is accessible to all the Users connected to the SQL Server. Private cache is only accessible over a transaction, for a particular User, for a particular company. This cache is cleared as soon as the transaction is completed. Which cache is to be used for which User depends on whether the Table from which the User is requesting data is locked or not. In case it is locked, Private Cache is queried else Global Cache is queried. The following procedures in Business Central support using Cache: GET GETBYSYSTEMID FIND FINDFIRST FINDLAST FINDSET COUNT ISEMPTY CALCFIELDS Whenever we make a call to the “FIND” functions, 1024 records are cached. The Data Cache size in Business Central can be changed using the “Data Cache Size” setting of the Business Central Server Configuration file. The default value is set to 9 which is equivalent to 500mb. Increasing the value by 1 doubles the cache size. If we want to latest data from the database to be fetched, i.e. if we want to bypass the cache, we can use the “SelectLatestVersion” procedure. The results from Query objects in Business Central are not cached. If there are multiple Server Instances over a single database, Business Central synchronizes the cache every 30 seconds by default. We can change this by using the “CacheSynchronizationPeriod” parameter in the CustomSettings.config file. Conclusion: Thus we saw how to Caching works in Business Central and how we can optimize it usage for maximum performance in Business Central.

Share Story :

Using Partial Records in Business Central

Introduction: Business Central allows us to load records partially, i.e. only certain fields from a table which can be defined by the User. As this requires less data to be pulled out from SQL and similarly less data to be sent over the network, using partial records provides a significant performance gain. Even more so if the table has multiple extensions attached to it. The methods for partial loading are also available on Record References. References: Partial Records – Business Central | Microsoft Docs Record.SetLoadFields Method – Business Central | Microsoft Docs Usage: There are two groups of methods which we can use for Partial Loading. First, which set the Fields to be loaded prior to fetching the records and secondly which load the fields after the initial fetching. SetLoadFields – It is used to specify the fields which are to be loaded when the record is to be fetched using the “GET” or “FIND” procedures. Reusing this on the same record variable leads to resetting of the fields to be loaded.  AddLoadFields – It is used to load another field, in additional to the fields that have been loaded. Calling this Procedure repeatedly on a record does not lead to resetting of the fields that are to be loaded.  AreFieldsLoaded – It is used to check if the fields mentioned are loaded already or not.  LoadField – It is used to load more fields in addition to the fields that have been loaded already. To load the fields it uses a technique known as JIT Loading. Conclusion: Thus we saw how we can make use of partial loading of records with minimal code in Business Central! As a side note, I would like to mentioned that it is not recommended to use a partially loaded record for Insert, Update or Delete operations as these operations require a record will all fields loaded.

Share Story :

Using Security Filters in Business Central

Introduction Business Central allows various levels of security that can be used to restrict User access to different features or objects. We can use Permission Sets to prevent User access to specific objects like reports or pages. For more refined, row-level authorization we can use Security Filters to restrict access to individual record based on some filters. References Using Security Filters in Business Central – Business Central | Microsoft Docs Pre-requisites Business Central OnCloud or OnPremise Configuration Suppose, you want the User to only be able to access a specific set of Customers. You can either create your own Permission Set from scratch, in which you will describe all the objects that the User will have access to or you can copy one of the existing ones by clicking on “Copy Permission Set” and then entering a new name for the permission set. Do note that you require proper permissions to make changes to Permission Sets as well. Open the Permission Set, by clicking on the “Permissions” action and Scroll to the Right. Click on the three dots next to the Security Filter field. Select the field(s) which you want to filter by clicking on the three dots next to the Field Number and then click on OK. Set a value for the filter in the “Field Filter” field. You can add as many filters as required and any Business Central filter is valid in this field (Except for wildcard characters). Once you are done, click on Close. Click on OK and add (in case there are no other permission sets and you have created your own) or replace (in case you have copied the permission set) the new permission set onto the User in the “User Permission Sets” tab of the User card. Login to the User Account and verify that only the records that match the mentioned filters are visible to the Users. Conclusion Thus we saw how to create and configure security filters in Business Central for maintaining record level security. As a side note, I would like to highlight that in Business Central, in case a User has multiple Permission Sets containing different levels of permissions for the same object then Business Central combines these Permission Sets and uses the least restrictive group of Permissions. As such if you apply a Permission Set with a Security Filter and another Permission Set without the filter on the same object, Business Central will use the one without the Security Filter as it is least restrictive.

Share Story :

ScanPayGo by LS Retail

The current Retail process supported by LS Central is simply for the customers to collect the items and bring them to the POS for completing the transaction. LS Retail aims to change this process with the introduction of their new product ScanPayGo. Using this app customers will be able to select the items to be purchased directly from within the app or by scanning the barcode on the item, manage or share multiple shopping lists , pay directly from within the app or pay at the POS by simply scanning one QR code instead of all the items as was done previously. It also allows paying using loyalty points if sufficient points are available. As a security feature the app has random checks in which after a transaction the customer has to confirm with a Staff member to verify the purchased items. It maintains a purchase history so that repeated transactions need not be scanned repeatedly. It help customers find the closest Store by providing a list of all the available Store ordered by the closest Store. It also displays the current available offers in the Store. All of which adds on to the seamless retail experience with minimal interaction. Retailers can customize the color scheme and logo of the app however they wish. Retailers can also offer personalized ads to Users using ScanPayGo! This application is going to be available for both Android and iOS.

Share Story :

Configuring Barcodes on POS Receipts

Introduction: Refunding a transaction is an everyday occurrence in Retail. LS Central provides us with the functionality to initiate the refund of a transaction by simply scanning one barcode! In this blog, we will be looking at how to configure this feature. References: https://help.lsnav100.lsretail.com/Content/LS%20Retail/POS/Hardware/Printing%20Receipt%20Barcodes.htm Pre-requisites: Microsoft Dynamics 365 Business Central LS Central Configuration: From Business Central, open the POS Terminal for the current Store. In the “Printing” tab, Set the “Receipt Barcode” ID to 101. Set the “Print Receipt BC Type” to “CODE39” or “CODE128_A”. You can optionally adjust the Barcode Height and Width but depending upon the POS Printer it may or may not be scannable as the resolution of the barcode suffers. The default parameters which are applied if you leave the fields to 0 are width – 8 and height 40. Set the “Receipt Barcode” to true. Once this is done, simply run the POS and generate a Receipt. When the Barcode at the bottom of the Receipt is scanned it should directly take the User to the refund screen of the POS. For instance, this is how it looks on the Virtual Printer: While, this is how it looks when using a real printer. Conclusion: Thus, in this blog we saw how to configure Barcodes on POS Receipt. Thanks for reading!

Share Story :

Using Web Content on POS

Introduction LS Central allows us to use HTML content on the POS which includes both Text and Images. Users can add extra information related to the Items here which can assist in the POS Users to make the sales much more efficiently. In this blog, I’ll be demonstrating how to configure the same. References https://help.lscentral.lsretail.com/Content/Fields/T_10001411.htm Pre-requisites Microsoft Dynamics 365 Business Central LS Central Configuration Open Business Central and search for POS Terminals. Open the POS Terminal for the current Store and set the “Item HTML” and “Item Image” property to true. Search for Retail Items and open the Item you want to add description and image for. Open the Item Card and Go to Navigate -> Master Data -> Item HTML. Here you can specify the description for the Item that you want to be displayed on the POS and click on Save. For instance: After that go to Navigate -> Master Data -> Images and click on New. Click on Import and select the Image of that Item and then Click on OK. Go to POS and search for the Item. Double Click on the description of that Item to see the Image and the HTML Content. You can even embed Videos if required! Conclusion: Thus, in this blog we saw how we can utilize HTML content on POS. As an additional side note I’d like to mention even using Javascript is possible, to a certain extent, so for those who are curious you can even create basic games for it. Thanks for reading!

Share Story :

Customizing POS Receipt Layout

Introduction POS Receipts are generated after every transaction that occurs on POS. The default receipt provided by LS Central is generally sufficient but as is in all things there are always exceptions. There are two approaches we can use to modify the POS Receipts and we are going to see them both. This is the default receipt provided by LS. I have marked division of sections using color. Red – Header Green – Body Blue – Footer References https://www.archerpoint.com/blog/Posts/learn-how-set-pos-receipt-enhancements-ls-retail https://help.lscentral.lsretail.com/Content/How-Tos-Created-By-Support/How-To-Set-Up-Receipts-LS-Central.htm Pre-requisites Microsoft Dynamics 365 Business Central LS Central Development Environment Setup for Business Central Configuration Using Receipt Printing from POS Terminal / Store Card We can add text directly into the Header or the Footer of the POS Receipts and also define some basic properties like bold, italic or wide for the text. It can be defined at POS Level or Store Level i.e. for individual POS Terminals or for all the POS Terminals in a Store. Go to POS Terminal Card. Go to Printing -> Receipt Printing Here you add static content, like Store Name, GST/VAT No, Store Address, etc in both header and footer. Here you can also define, if you want to specify the Item No. or Barcode in the POS Receipt. Similar, to this, we can also define for Store level, i.e. all the POS Terminals in a Store. Using the “POS Print Utility” procedure: In this method, we will write actual code to modify the receipt. If you are using NAV, then this is pretty straight forward, but in case of Business Central, we only have access to Events which we can subscribe to, to change the behaviour of the procedure. The highlighted four procedures do the majority of the work done in printing. PrintHeader -> Prints the content of the header defined in the Receipt Printing. PrintSubHeader: It prints the Information related to the current Transaction. PrintSalesInfo: It prints the actual Items of the Transaction along with VAT and other details at the bottom. PrintFooter: It prints the Footer Text defined in the Receipt Printing. Now that we know which procedure is responsible for which part of the Receipt, we can subscribe to that procedure’s event. For example, let’s try me modify the “Sub Header” part of the Receipt. As such we need to modify the “PrintSubHeader” procedure, so we subscribe to its event. The parameter, sender gives us a reference to the current instance of “POS Print Utility” codeunit which we can use to call all the procedures of that codeunit with the correct values. TransactionHeader is the current “Transaction Header” record. At the start of the procedure, we need to set the IsHandled variable to True so that once your procedure ends, the parent “PrintSubHeader” procedure exits immediately. DSTR – It is the design String, here we define the design of the Line that will be printed. It is at max up to 40 characters. It follows the pattern “#(alignment)##…”. The Design String is divided into sections, each section contains one piece of data. Value – It is a text array, which defines the data which is to be printed in the sections. The number of values set in the Value should be equal to the sections in the design string. Node – It is used as a Label for the data in the section. The number of values in this array should be the same as the values in Value array. Next, the essential part is the “FormatStr” procedure, the 4 booleans at the end are used to specify whether the String is going to be Wide, Bold, High or Italic respectively. After this, the final piece of the puzzle is the “AddPrintLine” procedure, the first argument is the “Section ID”, it is related to which part of the receipt we are printing in, it is better to set it the same as the procedure from which this event is being triggered. Next argument, specifies the maximum number of Sections that will be in the design string, just make sure it is more than the values you have provided. Next, we pass the Node and Value array, the Design String and specify whether the String is going to be Wide, Bold, High or Italic and the Tray at the end. The value for Tray can be taken directly from the Event’s parameters. Similar to this, we will add one more line and then we will check the results. The “PrintSeperator” procedure is used to draw a horizontal line across the receipt using dashes. Here is the final result: Conclusion: Thus we saw how to customize POS Receipts in LS Central either through POS/Store Receipt Printing or for advanced customizations through Event subscriptions.

Share Story :

Configuring Scheduled Jobs – Part II

Introduction: In the previous Blog, we saw how to configure the Schedule Job Header, this time we will configure the Sub-jobs. In Sub-jobs, we can define the Table structures to be followed, Tables the Data is supposed to be sent to, filters, replication counter fields and so on. References: Repl. Counter Interval, Scheduler Subjob (lsretail.com) From-Location Design, Scheduler Subjob (lsretail.com) Replication Method, Scheduler Subjob (lsretail.com) http://www.apanko.ru/showthread.php?t=3517 Pre-requisites: Microsoft Dynamics 365 Business Central LS Central Configuration: General:- ID:- Unique Identifier for the Sub-job. From-Location Design/To-Location Design:- These fields specify the structure of the tables. If the table structures are same in both sending and receiving locations, then you do not need to set this field. From-Table ID/To Table ID:- These fields specify the IDs of the tables. In most cases, these will be same only exception would be when you want to send data to custom Tables from BC/LS Tables. Replication Method:- It has two options- Normal :- In this method the entire table is transferred but as this is an expensive operation and unsustainable if the data in the table is growing constantly, there is another field “Replication Counter” which resides on the table which is to be transferred, it must be an integer field and every operation which modifies/inserts a record in the table, this replication counter field must be updated. Majority of tables provided by LS have a “Replication Counter” field in them. By Actions:- Every operation we perform on every table is logged into a “Preactions” table by LS. Then these Preactions are converted into “Actions” which are then used to transfer data. Field Transfer Type:- It specifies how to handle the fields of the table. It has three options- All:- All the fields from the “From Table” are transferred in the “To Table”. Include List:- Only the fields specified are transferred. Exclude:- All field except the ones specified are transferred. What to do:- It specifies the operations the transfer can perform. There are the basic operations Add, Update & Delete and then building on them there are combinations of these operations.Note:- Please use the delete operations carefully as it may cause unintended data deletion. For most uses, Update-Add is sufficient. Replication:– Action Table ID:- This field is automatically updated when “Replication Method” is set to “By Actions.” Move Actions:- Specifies whether “Actions” should be transferred along with Data. Use Truncate:- When using “Normal” replication method, if this is set to true, then the destination table is cleared and then new data is inserted in it from the source table. If you are using “Update-Add-Delete” as “What to do” then this is more efficient. Replication Counter:- Specifies which “Integer” field is to be used as the “Replication Counter.” Repl. Counter Interval:- If this value is set then the data to be transferred is divided into blocks. The size of the block is as defined in the field.For instance, as per the replication counter, 1000 records are to be transferred. But since sending a huge amount of data at once may burden the replicator we can specify the “Repl. Counter Interval” at 100, after which the “Sub-job” will run 10 times, replicating 100 records at a time. Update Repl. Counter:- Specifies whether the “Replication Counter” field in the destination table should be updated or not. Mark Sent Records:- In this field we can set a boolean field of the “Source Table” which will automatically be set to true, when the record is set. Please do note that none of the fields mentioned in the “Replication” tab are compulsory but creating a sub-job without using the available replication options may become slower and network intensive as entire tables are transferred. Transfer Field List: Go to Navigate > Sub-job > Transfer Field List Here we specify the field mapping between the source and destination tables. It also allows for some degree of Conversion in transferring, for instance, Set “Conversion Type” to “Constant” and set a value in the “Conversion String” field, then after transferring, the value specified in the “Conversion String” is set on all the records in the specified field. Make sure the field is of type “Text” or “Code” before using this. Another practical example would be, When transferring “User” table, if we simply send the password directly then the proper values are not transferred. This can be resolved by using “Skip Text Conv.” on the “Password” field before transferring. From-Table Filters: Go to Navigate > Sub-job > From-Table Filters Here we can specify filters to be applied to the source table. Linked Tables: Go to Navigate > Linked Data > Linked Tables Here we can specify data from which other tables has to be pulled along the main table, in the above example, as the sub-job is using data from “Customer” table, we have defined that along with that we also want data from “Customer Ledger Entry” table. We can also define field mapping for these tables by going to Navigate > Linked Table> Field List. To define the link and/or filters on this table, go to Navigate > Linked Table > Filters and Links. Conclusion: Thus, we saw how to configure Sub-jobs and a brief overview of the features it offers. Thanks for reading!

Share Story :

Login Error in BC after changing Server Date

Introduction: While doing some customization testing, which revolved around using different dates, I realized that once the date is switched back to the correct date, I was unable to connect to Business Central. I restarted the server instance, IIS, SQL Server services to no avail. Prerequisite: Business Central On-Premise setup with Web Server and SSL. References: https://serverfault.com/questions/217343/date-header-returned-by-iis7-is-wrong https://support.microsoft.com/en-us/topic/using-net-stop-and-net-start-commands-to-force-iis-services-to-re-read-the-registry-c6fe0d0b-9893-36d0-cc3c-47d03f9ccdde Verification: Logging into Business Central gave no errors, there were no errors in the Event Viewer that explicitly mention that it is a Date related issue. The way I stumbled across it being a date related issue is that in the Response that the Business Central server sent to the Login Request, was carrying the wrong date in it. When I switched the System Date back to the date mentioned in the Response headers, everything seemed to be working again. Solution: This issue is caused because when the system date is changed, the same is changed in IIS but when you change it back IIS does not refresh it and we have to manually reset it. Restarting it does not work, trust me, I tried. One way to do this is to execute the following commands on the Server: net http stop net http start These commands took a lot of time so be sure to have available down time before you run them. The other way, which is much simpler in my opinion, is to simply restart the Server. This stops all the services and restarts them which forces the IIS to reset as well. Conclusion: Thus in this blog, we saw how to resolve the issue of being unable to login after changing Server Date in Business Central. Hope this helps!

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange