Posts

Showing posts from February, 2025

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