Tag Archives: Business Central
How to Modify Existing Report Layout in Business Central
Introduction: To modify the layouts you can remove the fields, tables, or change the position fields. There is an option to extend the Table and Page but to make changes in the existing report there is no extension yet but there is a way you can change the layout of the report. Steps to achieve the goal: Search for Report Layout selection. Select the Report ID which you want to modify. Go to Process ->Custom Layout. Make a copy of the layout file to do that select new action it will ask you to insert RDLC or WORD according to it will create a file. Then go to layout action in Custom Layout Page->Export layout. Make changes in that file again. Import new modified layout using Import layout action. Make sure to update the layout. Import layout will only import your file you need to update as well. And then go to the Report layout selection page choose the selected layout of the report to be Custom Layout and select your modified report file in the Custom layout description. You can test your new report by Reports-> Run Report. Conclusion: Thus we saw how we can change the layout of existing reports using Report Layout Selection. Thank you very much for reading my work. Hope you enjoyed the blog!
Using Custom POS Commands in LS Central
Introduction: LS Central provides an easy way to add Custom functionality through the use of POS External Commands. These commands are executed on the POS and let me know you how to create them. For this example, we will create a POS Command, to remove all the lines from the current transaction. Pre-requisites: Microsoft Dynamics 365 Business Central On Premise V16.5 LS Central V16 Demonstration: You will need a Codeunit in which we define all the custom commands, all your Custom commands can be added in a single Codeunit. Make sure to set the “TableNo” property to “POS Menu Line” table. In the OnRun trigger, we have to handle two cases: Registering the module and associated commands. Procedure to execute when a command is called. For handling the first case, we create a procedure “Register” which takes a “POS Menu Line” as a parameter. In this procedure we use the “POS Command Registration” codeunit to register this module and all the associated commands. I prefer to use Global Labels to store the Module Code/ Module Description and Command Code/Command Description, as this way, any and all changes need be done only once but it is not necessary. Once this is done, the next step is to register the POS Module, this can be done in two ways: Using Retail Modules: Search for Retail Modules in BC Search. Click on “Process” and then “Register.” Search for your Codeunit and click on OK. Using “POS External Commands”: Search for Retail Modules in BC Search. Click on “Process” and then “Register” Search for your Codeunit and click on OK. You can confirm that your commands are visible by checking the list of POS External Commands. Now on the POS, we right-click on a button and click on “Button Properties” Then set your custom command, Now we add multiple Items. And when we press the button, this is the result, as expected. Conclusion: Thus, in this blog, we saw how to create Custom commands which can be used on POS. Thanks for reading!
How to add fields in the Business Central standard reports
Introduction: There are some needs where the client wants to add fields in the standard business central report. You cannot make changes in the Standard Business central report. We can change the layout of standard reports by using a custom layout that is present in Report Layout Selection. Steps to achieve the goal: 1. Go to Visual Studio Code -> Download the AL Object Designer Extension I want to modify Sales Credit Memo and I will make a copy of the standard report from the AL Object designer. Create a new report and paste the standard report code. Change the Report ID and Name and add a field that you want to be present in the Standard report. Build and Publish the code in business central. Go to Report layouts selection->Custom layouts download the original layout of the standard report and import it to the new report which you created -> Update Layout. Download the report layout from the new report. Change the layout according to your needs add the new fields which you want to be in the standard business central report. After adding the fields in the new report layout. Import the layout file and Update it. And use your customized report. Conclusion: Thus we saw how we can add fields in a standard business central report by using the AL Object Designer extension. Thank you very much for reading my work. Hope you enjoyed the article!
How to replace your customized report with the existing Business Central standard report
Introduction: There is a need where you want to replace your customized report with the standard business central report. In which the customized report is a copy of the standard report along with new fields added. So how can you avoid to show two reports with same caption one is your customized report other is standard Business central report. Steps to achieve the goal: In my example, I want to add a field in the Vendor Payment Receipt field. I copied the standard report code. Once you have updated the Layout and add the field publish the code you will be able to see two reports of Vendor Payment Receipt. So in order, that client doesn’t use the old report we can use the Report Management Codeunit. Publish the code and open the report you will be redirected to your Customized Report. Conclusion: Thus we saw how we can replace the Standard report with our own Customized Report using the Report Management Codeunit. Thank you very much for reading my work. Hope you enjoyed the article!
Upcoming application features in Business Central Wave 2 2020
INTRODUCTION: In this blog I would like to share few functional features which are planned for Business Central Wave 2 2020. Also, in this blog I will be sharing some insights into the planned features. Business Central Company Hub extension: Accountant Hub is deprecated to Company Hub in this release wave. Company Hub contains the same features, and Microsoft recommends using Company Hub as a replacement for Accountant Hub. More details here: https://www.olisterr.tech/2020/07/announcement-microsoft-dynamics.html Group VAT reporting: Ease and support for seamless VAT group reporting which will smoothen VAT liability on intra-group entities and optimizing the tax filing. Default unit cost for non-inventory items: Now users will get the default feature of updating cost on Nonstock or catalog items and service items, as these costs impacts production, assembly and sales transactions. Track packages from more types of sales documents: Now users will be able to reverse the posted bank reconciliations. The bank reconciliation will automate the reconciliation of differences. The Payment Reconciliation journal will support application against employee ledger entries, allow one-to-many matching, have preview posting enabled, separate number series, and user-defined document numbers. Bank reconciliation improvements: Now users will be able to reverse the posted bank reconciliations. The bank reconciliation will automate the reconciliation of differences. The Payment Reconciliation journal will support application against employee ledger entries, allow one-to-many matching, have preview posting enabled, separate number series, and user-defined document numbers. Consolidation file format support for Dynamics 365 Finance: The file format options for a business unit in Business Central will include an option for Finance and Operations. Notify users of high-risk changes in selected setup fields: Notification enabled for any change in the value of highly critical field using change log functionality. Use conversion templates to convert contacts to vendors and employees: User can now convert a contact a vendor or an employee. Contact conversion template can be used using conversion. Use recurring journals to allocate balances by dimension values: In recurring general journal using recurring method ‘Balance’ or ‘Reversing balance’ users can now allocate cost of source GL account dimension-wise, earlier only consolidate cost was possible. Use the Copy Journal function on general journals and G/L registers when reversing entries: Copy Journal functionality will be made available to copy the general journal batch with opposite signs (a reversing journal) and different posting date & document number. Use Word document layouts to customize outgoing customer documents: Users can now export document layout to work for the following documents: Shipments, Return Orders, Service Quotes, Orders, Invoices, and Credit Memos. Simply modify the layouts and import them back into Business Central to use next time you send, for example, a shipment, return order, or a service document. Use contact Mobile Phone Number and Email consistently across application: User can now use the Mobile Phone Number and Email fields on data entry pages, report data sets, report layouts, and segment lines that have contact details in Business Central. CONCLUSION: Once there is a public preview/ general availability is released then I will create a follow up blog explaining each feature in detail. Kindly feel free to suggest. Hope this helps!
Table Properties in Business Central
Introduction: In this blog, I will be addressing some of the Table properties in Microsoft Business Central. Pre-requisites: VS Code AL Language Extension Microsoft Dynamics NAV / Business Central Properties: 1. CharAllowed It sets which characters are allowed in the field. This property can be applied to Table and Page fields. Charalowed takes parameters in a combination of two characters as shown below, where characters “1 to 4 “, “7 to 9” and “a to d” are allowed. An example of this property is given below. Definition Error 2. DataPerCompany It sets whether the table data applies to all companies in the database or only the current company. The default value for this property is true. This property can only be applied to Tables. The User table is an example where Datapercompany is false. 3. DataCaptionFields Sets fields defined on the Top Left Position of the Card page. It can be applied in Table. Syntax: DataCaptionfields= Field1,Field2,Field3; In below example, I have used No, Name and Type fields for Caption. Definition Result 4. Enabled Sets a value that indicates whether a field is enabled or disabled. It can be applied to Page fields, Table fields, and Actions. In the below example, I have set Enabled Property to True on Name field, therefore Name is field is visible to users but it is not editable and it is displayed Gray in color making it less highlighted than other fields. Enable = False Hope this helps!
Select and Email Multiple attachments from a list of Documents
Problem Statement: I have a requirement where the user will select multiple attachments of choice from a list of Documents and Email them. Pre-requisites: VS Code AL Language Extension Microsoft Dynamics Business Central Solution: Step 1: Create a drill-down on the field where the user will select attachments from a list of Documents. Here we have used Page Document Attachment Details as a drill-down page where I have attached some documents. Drill Down In the above code, I have created a drill-down of page Document Attachment Details. SetSelectionFilter() – To get selected attachments from the list of Documents. Step 2: Here I have created Instream and Outstream Objects for Attachments as shown below: In the below code Rec_Sample is a Record variable for sample table which contains the Media field “Document Reference” which stores the unique Document Reference ID of a single Document. After that, the same document is exported and Imported using Exportstream and Importstream. And AddAttachmentStream is called with the Instream object to add the attachment. This is done for the number of attachments selected and then the mail is sent. Conclusion: This way we can send Multiple attachments selected by the user and email them. Hope this helps!
Extend a User-Created Table
Introduction: Microsoft Dynamics Business Central allows extending Pre-defined Tables, which is basically Customization and it is achieved using Extensions. Using Extensions developers can modify Pre-defined Tables according to requirements. But the extension of a Table can be done only if its “Extensible” property is set as True. This property is by default set as True for Tables. Now suppose a developer wants to extend a table that is created. Pre-requisites: VS Code AL Language Extension Microsoft Dynamics Business Central Solution: Step 1: Set the Extensible property of the Table that is supposed to be extended as shown below: In this case, the table to be extended is “Properties”. Extensible Property Step 2: Now go to Extension Management and get the AppID, Publisher, Name of App and Version as shown below: App Details Put the above details of App in the dependencies section of the new extension where the table is to be extended as shown below and download symbols: Dependencies Step 3: You can see that the “Properties” table is now available for extension. Here I have added a field “Extended Name” in the Properties Table. Also, that field can now be seen by accessing Properties Table by URL. Extended Table Thank you. Hope this helps!
How to retrieve a Sub-string from a String
Problem Statement: We have a requirement where the client wants a part of String from Sales Order No. which is Code(Data type) and it is auto-generated from Number Series. The Sales Order No. value is “SO/123/789/456”. The required Sub-string was: 123<Space>789. Pre-requisites: VS Code AL Language Extension Microsoft Dynamics NAV / Business Central Solution: As per the requirement, we need to first retrieve Sub-strings “123” and “789” and this can be achieved using SELECTSTR( ) function. But SELECTSTR() only retrieves a Sub-string from a comma-separated String. And the Sales Order No. string is a slash-separated string. So firstly we need to convert this string to comma-separated string, which is achieved in the below-presented screen. CONVERTSTR(String, From Characters, To Characters) In the above Screen, “SalesOrder No.” is initialized in a text variable “SoNumber” and then is converted to a comma-separated string. The code is: CONVERTSTR( String: Text, FromCharacters: Text, ToCharacters: Text ) Now comes the part where we retrieve Substring from this converted String using SELECTSTR( ) function as the string is now converted into a comma-separated string, below screen shows how it is done. SELECTSTR(Number/Position, Comma-Separated String) As you can see in the above screen how SELECTSTR() function is used to retrieve substring on the 3rd and 4th position of the String and stored in text variables “No1” and “No2” respectively. And these variables are then initialized to another variable with space. The code is: SELECTSTR(Position, Commastring); In the above example the code is: SELECTSTR(3, Separatenumber); SELECTSTR(4, Separatenumber); Conclusion: We can retrieve a comma-separated string or any other character-separated string using CONVERTSTR() and SELECTSTR() functions. Hope this helps!
Update Sub-form (Sub-Page) from Main Page to apply Filters.
Problem Statement: I have a requirement where I want to update the Subform(Part page) from the Main page, this Subpage(Subform) is linked to the Main page by SubpageLink Property. The Subpage is a List page and I want to filter this list by a field from Main Page. Pre-requisites: VS Code AL Language Extension Microsoft Dynamics NAV / Business Central Solution: To solve the above Problem statement we have to make use of the Currpage.Update() function which shall update the Subpage. As you can see in the below window a function is created Vendorfilter() on Subpage with the “vendor” parameter, in this function filter is added for the vendor on the part page and then CurrPage.Update() is used. This function will update the Subpage with the vendor. Now, call this function on “OnValidate” trigger of the Main page field, here we have “Vendor” field on Main Page. The calling of Function is as follows: CurrPage.<SubpageName>.Page.<FunctionName>(Rec.<FieldName>); In this example we have CurrPage.POLines.page.Vendorfilter(Rec.Vendor); Conclusion: Thus we can achieve updating a Subform from a Main Page. Hope this helps!