Posts

Dynamic Visibility of Controls Company Specific (Hide and show fields dynamically)

Image
Suppose you have a requirement to show a field in some companies and hide it in others.  First Read this  Visible Property For example, I have added a 'Lease' section to the Sales Order page, which contains three fields: Lease Status, Lease Amount, and RKD Proyecto. The visibility of this section is controlled by the isVisible variable, which is set within the CompanySpecificVisibility procedure. This procedure checks the company name from the Company Information. Based on the company name, we handle visibility by setting isVisible to true for 'CRONUS IN', and false for 'My Company' and 'My Company US'. The visibility logic is executed when the page opens, using the OnOpenPage trigger. So, when the user opens the Sales Order page: If the company is 'CRONUS IN', the 'Lease' section is visible. If the company is 'My Company' or 'My Company US', the 'Lease' section is hidden. Code: pageextension 50704 "Sales Orde...

Dynamic 365 Business Central: Automating the Transition from Purchase Quotes to Orders Using Job Queues

Image
Suppose you have a requirement to automatically transfer all released or open purchase quotes to purchase orders in Business Central, without any human intervention. Here, I will discuss how you can handle this process. The standard Codeunit 96, 'Purch.-Quote to Order,' is used for this purpose. Typically, if you use this codeunit directly in the job queue to transfer, you may encounter the following error: Reason: The Job Queue cannot be created on its own without a custom report or Codeunit to call.  To convert released Purchase Quotes to Purchase Orders using the Job Queue, you must: First, you need to create a codeunit that contains the logic for converting a Purchase Quote into a Purchase Order. Below is a simplified version of how the codeunit might look: codeunit 50100 "AutomatedPurchQuoteToOrder" {     Subtype = Normal;     trigger OnRun()     var         PurchQuoteToOrder: Codeunit "Purch.-Quote to Order";   ...

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...

Dynamics 365 Business Central: Enabling Custom and Default Tables in the "Search Company Data" Feature

Image
 Hi Colleagues, Today, we will discuss how we can search custom table data using the " Search Company Data " feature in Business Central. For more information regarding the " Search Company Data " feature, you can refer to the official Microsoft documentation: Search Company Data I have added a test customer to the default customer table.  and created three test entries in the Test Header custom table. To search for data, enter one or more keywords in the "Tell Me" search box. Alternatively, when you run "Tell Me" in the context of an editable page, it will automatically search for the value in the currently selected field. Click on " Search Company Data ". Here, you can see that the search results include the top results from the tables you have access to. However, custom table data is not showing in the list. Reason : Test Header is not enabled in the list. Now, follow below steps to add default or custom table data to the search list...

Copy a Production or Sandbox Environment in Business Central

Image
Few simple steps for Copy a Production or Sandbox Environment  Open Business Central, click on the Settings icon, choose Admin Center Within the Business Central Admin page select the production environment that you wish to copy. Select Copy from the ribbon. Specify your new environment's name and type.  Select Copy Once the copy process has finished you'll see a new environment listed in your environments tab.  https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/tenant-admin-center-environments-copy Note: You can only have 3 Sandboxes & 1 Production environment. If there are already 3 Sandboxes you can delete one and after the deletion is done, you can copy the Production Environment.  Business Central 2021 wave 2 (BC19) new features: Copying environments of different types (Production to production, Sandbox to sandbox, Sandbox to production) Thank you for reading. Regards,  Khushbu Rajvi

How to Create a Sandbox in Dynamics 365 Business Central

Image
Few simple steps for creating a sandbox environment in the D365 Business Central tenant. Access the Admin Center for Business Central by clicking on the gear symbol and selecting Admin Center. Click New to start creating new environment After entering the Environment Name, Environment Type as Sandbox, and Country, click Create button: It will take some time to prepare the sandbox environment.  After preparing the environment, the status will be shown as Active: Now the sandbox environment is ready and you can visit the environment: Thanks For Reading. Regards, Khushbu Rajvi