Disable field on change of tab in D365 CE
Use case – Our requirement is to enable field description field on invoice line form on clicking of tab General. Let’s see how we can achieve this Solution – Step 1 – Create web resource with below function- var invoiceLineCustomization = { unlockField : function(executionContext) { var formContext = executionContext.getFormContext(); formContext.getControl(“description”).setDisabled(false); }, } Step 2: Add this web resource on tab property event TabStateChange and try. (path to go to event tab – Click on tab -> change properties -> event) Output – Hope this helps !
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 :
Get Time in Hours and Minutes from a Date Field in CRM using JavaScript.
D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you just need the time in Hour and Minutes format from the selected date in the Date field, This can be achieved using a JavaScript. In this blog lets see how we can get the time entered in the date and time field and format it in hours and minutes format. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Time entered in the date and time field as shown below. This code gets the date and time (hours and minutes) selected in the date field and will format the hour and minutes in the format “HH:MM“. Hour – (getHour()) Minutes – (getMinutes()) Output – Note : You can also add the AM / PM to the time string I have not added it in my time string “strTime” but have stored the value of it in “ampm“. Hope this helps !
Share Story :
Get Month | Day | Year from a Date field in CRM using JavaScript.
D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you need just the month from the selected date in the date field or say the date or year from the selected date in the date field, This can be achieved using a JavaScript. In this blog lets see how we can split or get the Month | Day | Year from a selected date in the CRM Date and time type field. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Month | Day | Year and Time of the entered date as shown in the below script. This code gets the date selected in the date field and splits the date into Month – (getMonth()) Note : January – December is (0-11) hence add 1 so make it (1-12). Day – (getDate()) Year – (getFullYear()) This code gives the month date and date in 2 digit format i.e. if the date is a single digit say 9 it will give it as 09. You can further use this according to your requirement either to change the date format or for many other date related customizations. Hope this helps !
Share Story :
[Quick Tip] Get SubGrid View Id using Primary Control or Selected Control for Ribbon button’s enable rule in Dynamics 365 CRM.
Use case: I have two entity Awards and Awards category. We have SubGrid on the Awards entity form for Category with Custom Ribbon button. We want to have the button should be visible on specific view only and below are steps to do so. Step 1: Configure the Ribbon Button Create a Ribbon Button, create a command and enable rule. Added enable to Command and command to ribbon button. To enable rule, create a custom rule and pass the JavaScript and parameter. Step 2: Get View id based on the CRM parameter: Now, Get Subgrid view id by passing the CRM parameter in the custom rule. When CRM parameter is Primary Control When CRM parameter is Selected Control Step 3: Write script for Enable Rule for Custom Ribbon Button. We will write a script that will enable or disable the Ribbon based on the view ID using the above code based on the passed parameter. Result: I have written the enable rule that Button should be visible only on the Active Award Category view: Result View of Current View that we get from the Controls in Web Browser Console App Full Code:
Share Story :
How to Export Text file from Business Central?
Introduction: Business Central provides you the feature to export the data in Excel in General Ledger entries, Customer Ledger entries, etc. But we can export data in a text file. In this blog, we will see how we can export data in the form of a text file. Steps to achieve the goal: Create a codeunit that will export the data in text. We will be needing Temp Blob Codeunit, Instream, and OutStream to read and write the data in the file. Below is the code which will read and write the data in the text file. You can use dynamic filename also by assigning a field value in the FileName variable; FileName: Rec_ComapanyInformation.FileNameText // FileNameText is the field present in the Company Information Page which will be used as Filename of the exported text file. We will be also using an action that will call the Codeunit function (GenerateTextFile) The output of the above code is To avoid using multiple times Write Text function if there is a lot of data that needs to be pulled from multiple fields. You can use a variable and store all the values in that variable and then assign that variable in the WriteText function. 9. The output of the above code is Conclusion: Thus we saw how we can export data from Business Central in a text file. Thank you very much for reading my work. Hope you enjoyed the article!
Share Story :
Disable field in Business Process Flow in D365 CE using JavaScript
Use case – Our requirement is to mark field Purchase time Frame disabled in Business process flow on change of disable field(custom field) on opportunity form. Let’s see how we can achieve this Solution – Step 1 – Create web resource with below function- Add header_process before schema name of field. Here schema name of purchase time frame field is purchasetimeframe. And after adding header_process_purchasetimeframe var opportunityCustomization = { //opportunityCustomization.disableField disableField : function(executionContext) { var formContext = executionContext.getFormContext(); var disable = formContext.getAttribute(“cf_disable”).getValue(); if (disable == true) { formContext.getControl(“header_process_purchasetimeframe”).setDisabled(true); } } } Step 2: Add this web resource on form load, on Save and on change of the field. And try Output – Hope this helps !
Share Story :
Starting amount showing blank in X/Z report in D365 Commerce (Retail)
In this blog, I am going to showcase how to resolve the error while printing the X/Z report from POS. In the store, go to payment methods. Select the tender Remove/ Float payment method. The payment method configuration for “Tender remove/float” was incorrect. If you don’t want to have the same problem be sure to unmark all the “tender declaration options” at this payment method. If you need to unmark after saving it you need to do it at RetailStoreTenderTypeTable.counting required there will be a record per payment method per store, so update as many as you need. After performing these steps, run Full sync from Channel Database. Refresh the POS link. You will able to see the start amount in both X/Z report. Hope this helps!
Share Story :
Issue in returning Invoice Orders in D365 Commerce (Retail)
In this blog, I am going to showcase how to resolve the error while returning invoice orders in Retail POS. When a customer will come to the shop and want to return the order which already invoices then getting following error on the POS This error was occurred because the return reason code setup is missing. Steps to Configure Return reason code. Set up return reason code groups Go to Sales and marketing > Setup > Sales orders > Returns > Return reason code groups. Select New to create a line for a new return reason code group. In the Return reason code group field, type an identifier for this group. In the Description field, type a brief phrase to explain how this group will be used. Set up return reason codes This procedure helps you set up return reason codes that you can use to indicate why a product was returned by the customer. Go to Sales and marketing > Setup > Sales orders > Returns > Return reason codes. Press CTRL + N to create a new return reason code line. In the Return reason code field, enter text to identify this code. In the Description field, enter text to describe the return reason code. Use the Return reason code group drop-down list to add the code to a return reason code group. Once all setup complete. Run 1030, 1070, 1090, and 1110 and refresh the POS link. Now you will get the below info code to enter the reason for the return and you will successfully return the invoice order. hope this helps!