Posts

Showing posts from January, 2025

Dynamic 365 Business central: How to Automatically Insert Line Breaks After a Specific Character Limit

Image
Suppose, you may have a requirement to break long text into multiple lines after a certain number of characters in Business Central. For example, when dealing with lengthy descriptions in fields like "Work Description," it's important to ensure the text wraps properly to maintain readability. In this scenario, I have implemented a solution using a tableextension to automatically insert line breaks after a specified character length (45 characters in this case). The code takes the input string, breaks it into lines, and formats it accordingly before writing it back to the "Work Description" field. This ensures that the text is displayed in a neat and user-friendly manner in the system. Code:   tableextension 50140 MyExtension extends "Sales Header" {     trigger OnInsert()     var         TypeHelper: Codeunit "Type Helper";         Crlf: Text[2];         InputString: Text[2048];       ...

Dynamic 365 Business central: Header on First, Footer on Last page in RDLC Reports

Image
Customizing Headers and Footers in Business Central Reports RDLC: First Page and Last Page Tricks Suppose you are working on a report, and there is a requirement for the header to appear only on the first page and the footer to appear only on the last page of the document.  It's always a good practice to check if there are properties available that can simplify your task. In this case, the PrintOnFirstPage and PrintOnLastPage properties for headers and footers can be very useful. Here's how you can handle it: Open the RDLC Layout. In the Header, right-click and select Header Properties. Enable the option Print on first page and click OK. In the Footer, right-click and select Footer Properties. Enable the option Print on last page and click OK. Save the changes, publish the report, and test the output. Expected Output: • For a multi-page document: The header will appear only on the first page. The footer will appear only on the last page. • For a single-page document: Both t...