AI Integration
Upload and Use Files in AI Conversations
4D 21 R2 introduces native file upload support in 4D AIKit, allowing your applications to send documents such as PDFs directly to the AI model and use them as first class context in AI conversations. A file enters the system once and immediately becomes the reference point for everything that follows, whether the user is asking for a summary, extracting specific information, or exploring a particular section.
That flow is intentionally explicit. Files are uploaded using OpenAI.files.create, where you define their purpose and optional expiration. The call returns a file identifier, which you attach to an OpenAIMessage to make the document part of the conversation context when calling the chat helper. You decide when a file is introduced, when it is reused, and when it leaves the system. Nothing is inferred. Nothing is hidden.
Because the document itself is what the AI works with, there is no duplicated content and no parallel representation to keep in sync. Users interact with the original file they recognize, and responses stay anchored to that exact material. Filenames are preserved, size limits support real documents, and expiration policies give you control over how long data lives.
The same API lets you list uploaded files, retrieve their metadata, or delete them when they are no longer needed, which keeps lifecycle management predictable in production. The interaction stays simple by design. A document goes in, AI features build directly on top of it, and the logic in between remains minimal, deliberate, and easy to reason about.
Vector Based Ordering in Queries
In 4D 21 R2, vector queries can now order results by similarity, not just filter them. A query no longer stops at finding matching records. It decides which ones should surface first. That distinction matters because semantic search only works when relevance is visible. Similar results are not enough. The closest match needs to lead.
That behavior is built directly into the query itself. When a vector field is used in both the filter and the order by clause, 4D reuses the same similarity calculation to rank the results. The comparison that determines whether an entity matches is also what determines its position in the result set. There is no secondary logic to maintain and no reordering step after the query runs. Relevance is defined once and applied consistently.
Because this is an extension of existing ORDA queries, nothing new needs to be learned. Vector fields are supported in the order by clause of DataClass.query, EntitySelection.query, and REST requests. Ordering can be ascending or descending, combined with classic filters, and mixed with traditional sorting such as dates or numeric fields. When multiple vector comparisons are present, the ordering reliably uses the first one, keeping evaluation explicit and predictable.
The query carries the full intent. You describe what you are looking for and how relevance should be applied, and the data comes back already ordered by meaning. No extra commands. No post processing. Just a query that knows which result matters most.
4D Qodly Pro
Qodly Pages Accessible from the 4D IDE
With 4D 21 R2, Qodly Pages can be created and edited directly from the 4D IDE. They are no longer something you reach for on the side. They live where the rest of your application lives. When backend logic, data modeling, and web UI belong to the same app, staying in one place keeps momentum intact.
Qodly Pages now appear in the 4D Explorer through a dedicated folder, alongside the structures you already work with. Creating a new page or opening an existing one starts from there. Triggering either action opens Qodly Studio in a browser, preferring Chrome when available and falling back to the system default otherwise. The transition is immediate and intentional, keeping you anchored in the project while working on the web interface.
User Interface
Fluent UI Design System for 4D Forms (Developer Preview)
With 4D 21 R2, Fluent UI becomes available as a new way to render 4D forms on Windows, as a Developer Preview. It introduces Microsoft’s Fluent UI design system into 4D applications, bringing a modern visual interface that already feels familiar to users because it matches what they see every day in Windows, Office, and Teams.
-
Fluent UI changes how forms are perceived, not how they are built. Existing forms keep their structure and logic. The difference is visual. Spacing feels more balanced, text is clearer, and the interface aligns naturally with modern Windows conventions, including native support for light and dark modes, without forcing layout rewrites.
-
Adoption stays under your control. Fluent UI can be enabled globally for a project or applied selectively, form by form. You decide where modernization makes sense and where the classic look should remain, keeping changes incremental and intentional.
-
Because Fluent UI uses modern rendering, some visual metrics differ slightly from the classic style. Text and certain widgets, such as checkboxes, may appear a bit larger or more spaced. In forms designed with very tight, pixel-level layouts, this can require minor adjustments to preserve the intended alignment.
-
Fluent UI is integrated directly into 4D. Installation and deployment are handled through the platform, with the option to bundle everything into the application or rely on the client environment. There are no external dependencies to manage manually.
-
Runtime behavior remains predictable. If Fluent UI cannot be activated on a system, the application automatically falls back to the classic rendering. No errors are shown to users. The application continues normally, with only a diagnostic entry recorded for visibility.
-
Styling evolves alongside rendering. Forms can react to whether they are displayed in classic or Fluent UI mode, making it possible to refine visuals progressively without affecting unaffected parts of the application.
-
Standard dialogs follow the same direction. Alerts, confirmations, requests, and system windows adopt the Fluent UI look when enabled, keeping the experience consistent across the application.
Fluent UI in 4D 21 R2 is a major step forward in modernizing the user interface. Support will continue to evolve based on developer feedback, allowing the design system to mature while keeping existing applications stable. The code stays familiar. The workflow stays intact. The UI moves forward with the platform it runs on
4D language
Unified Syntax Checking and Code Completion
In 4D 21 R2, syntax checking and code completion share the same inference logic. The editor and the compiler no longer interpret code differently. What IntelliSense infers while you type is exactly what the syntax checker and compiler understand, which keeps feedback reliable and removes hesitation while writing code.
Errors are now reported where they actually occur. Only the token responsible for the problem is underlined, not the entire expression around it. In multi line statements, the marker appears on the precise line where the issue originates. You hover, you see the problem, fix it, and move on without scanning surrounding code or second-guessing what the editor is trying to say.
Because inference is unified, completion suggestions and error detection reinforce each other. Complex expressions are inferred consistently, and when a type cannot be determined, it is explicitly flagged instead of silently defaulting. Invalid casts, unexpected properties, undeclared variables, incorrect parameters, and incompatible operators are caught early, while the code is still in motion.
This behavior is consistent in the environments developers actually use every day. The 4D IDE and VS Code rely on the same rules and the same error model. There is nothing to configure and nothing new to learn. You write code once, and the feedback you get means the same thing everywhere.
4D Write Pro
Automatic Indentation for Bulleted Lists
In 4D 21 R2, bulleted and numbered lists created using standard actions are automatically indented in 4D Write Pro. Lists now align correctly inside the page without manual margin adjustments, which removes a small but recurring interruption when formatting documents.
When bullets are applied through standard actions, the text is pushed just enough to keep the list readable and visually balanced. The adjustment happens immediately and consistently. Bullets appear where users expect them to be, and documents keep a clean layout without additional formatting logic in code.
The behavior stays predictable. Removing bullets using a standard action also removes the added margin, returning the paragraph to its previous layout. This avoids subtle alignment issues, especially in documents where list styles change dynamically.
The indentation matches the document’s default tab offset and respects text direction. Left-to-right text is indented on the left, right-to-left text on the right, keeping list rendering correct in multilingual documents without extra handling.
List formatting becomes something you no longer think about. The document stays clean, and the code stays focused on content instead of layout corrections.
4D Component
Find in Design Across Components
In 4D 21 R2, Find in Design searches beyond the host project and into all accessible components. A search no longer gives you a partial view. It shows where a method or symbol is actually used across the entire application, which matters the moment shared logic is touched and assumptions stop being safe.
Search scope is explicit. You can target the host project, a specific component, or the host and all components together. Results coming from components are clearly identified, so context is never lost and nothing needs to be inferred. One search gives you the full picture.
This becomes especially valuable during refactoring. You update a method and immediately see every reference, including those buried in components you have not opened recently. When results are exported, that context is preserved. Each line includes the project or component it belongs to, making the output usable for reviews, audits, or external analysis without rework.
The feature builds on project mode indexing. Components with available source code are included automatically, and search scope and metadata are carried through results and tooltips. Even large result sets stay readable and unambiguous.
Search stops being a guessing tool. You look once, see everything, and move forward with certainty.
Custom Icons for Component Dependencies
In 4D 21 R2, component dependencies can display a custom icon in the Component Manager. Instead of every entry looking the same, each component can carry its own visual identity, which makes scanning dependency lists faster as projects grow.
Icons are picked up automatically. If a component contains a logo.svg or logo.png file in its Resources folder, 4D uses it as the component icon in the Component Manager. No configuration is required. When both formats are present, the SVG version is preferred to ensure sharp rendering at any size.
This small change shifts how you navigate dependencies. Official components, internal tools, and third party packages are easier to distinguish at a glance. You spend less time reading names and more time acting on what you see.
Nothing about component behavior changes. Only recognition does. And that reduces friction every time you open the list.
4D view Pro
spreadJS Engine Updated to 18.2
In 4D 21 R2, 4D View Pro is built on top of SpreadJS version 18.2, with a Ribbon fully aligned with this release. Because 4D View Pro capabilities follow the engine beneath it, this update immediately improves performance and unlocks new features without changing how existing documents are built or maintained.
- Sheets feel faster and lighter. Rendering and interactions are more responsive, and PivotTables use significantly less memory. Large datasets and complex dashboards remain fluid, even as they grow over time, which reduces the kind of friction that usually appears only after prolonged use in production.
- PivotTables also gain flexibility. Data sources can be changed without rebuilding layouts, subtotals can be displayed per field, full worksheet columns can be used as sources, and formatting control becomes more granular. Keyboard navigation in filter dialogs improves usability for data-heavy workflows, making frequent adjustments quicker and more precise.
- The calculation engine expands with functions such as TRIMRANGE, REGEXTEST, REGEXEXTRACT, REGEXREPLACE, GROUPBY, PIVOTBY, and PERCENTOF. These functions allow more expressive transformations directly inside the sheet, reducing the need for preprocessing or auxiliary columns and keeping logic closer to the data.
- Import and export workflows are also strengthened. XML maps can be exported without loss, and macro-enabled Excel formats such as XLSM and XLTM are preserved during import and export, even when macros are not executed. This keeps compatibility intact in enterprise environments where structure matters as much as execution.
All of this comes from a single engine update. No migration steps. No behavioral changes to existing documents. Just a stronger foundation that makes current View Pro content more capable and future use cases easier to extend.