Skip to main content

Posts

Showing posts from July, 2024

🔄 Convert Available Inventory to Kilograms (KG) in X++ – D365 F&O

When working with raw materials in Dynamics 365 Finance & Operations (D365 F&O), it’s common to encounter situations where the inventory is stored in one unit (like Liters or Packs), but needs to be viewed or calculated in Kilograms (KG) for costing, reporting, or analysis. In this blog, we’ll walk through a practical X++ code snippet that demonstrates how to convert available inventory (AvailPhysical) into KG using D365’s standard Unit of Measure (UOM) conversion. 📌 Business Scenario Suppose you have a chemical item stored in Liters , but the production or costing team needs to see its available inventory in KG . You’ll need to: Fetch the item’s AvailPhysical from the InventSum table. Get the current unit of measure (UOM) for the item. Convert that quantity into KG , based on predefined unit conversion. 💻 X++ Code – Inventory Conversion to KG Here’s the code block that does exactly that: //******************** Avail Physical as per KG Unit conversion *...

Introduction to X++ Variables

 X++ is a high-level programming language used primarily in Microsoft Dynamics 365 Finance and Operations. Understanding how variables work in X++ is fundamental for managing data and performing various operations within the ERP system. What is a Variable? A variable in X++ is an identifier that points to a memory location where data of a specific type is stored. The characteristics of a variable, such as size, precision, default value, and range, depend on its data type. Variables are crucial for storing and manipulating data during the execution of a program. Variable Scope The scope of a variable defines where it can be accessed within the code: Instance Variables : Declared in class declarations and accessible from any method within the class or its extensions. Local Variables : Declared within a method and can only be accessed within that method. Declaring Variables When you declare a variable, memory is allocated, and the variable is initialized to its default value. Variable...

Introduction to X++ (Detailed X++ Language Reference)

  Introduction to X++ X++ is a high-level programming language designed for enterprise resource planning (ERP) systems and database applications. It combines object-oriented, application-aware, and data-aware paradigms to facilitate complex business process management and data manipulation. Key Features of X++ Classes : System Classes : Provide core functionalities, such as file handling, collections, and data manipulation. Application Classes : Manage various business processes specific to ERP systems. Reflection : Allows introspection of classes to dynamically access properties and methods at runtime. Tables : Access to Relational Tables : X++ allows direct interaction with database tables using syntax similar to SQL. Keywords : Includes keywords for data definition and manipulation, akin to SQL. Reflection : Supports introspection on tables for dynamic access to fields and methods. User Interface : Forms and Reports : X++ provides the ability to create and manipulate UI elements...