What’s new in 4D 20 R9

AI Integration

Add AI Capabilities with the built-in 4D AIKit Component

4D AIKit is a built-in 4D component that provides smooth integration with powerful third-party AI APIs like OpenAI.

With just a few lines of code, you can generate text, analyze and categorize images, moderate content, and automate complex workflows. Whether you’re building an intelligent chatbot, summarizing long documents, or tagging media files automatically, AIKit gives you direct access to cutting-edge AI capabilities—right inside your 4D environment.

4D Write Pro

Use the Built-In Writing Assistant to Improve Documents

4D Write Pro now features an AI-powered writing assistant that enhances your writing process by offering real-time support for drafting, editing, and refining documents.

Integrated with OpenAI, this assistant helps generate ideas, fix errors, and provide context-aware suggestions to improve clarity and coherence.

You can quickly access AI tools to summarize, translate, check grammar, or rewrite content, all designed to save time and improve document quality.

The request history feature allows easy navigation through previous interactions, making it simple to track and reuse content.

While in preview, this feature will continue to evolve with even more enhancements in future updates.

Control Email Formatting with Custom White-Space Options

Ensure clean and consistent email formatting by choosing the CSS white-space value during MIME export. This option helps avoid unwanted line breaks caused by certain mail clients misinterpreting white-space:pre-wrap, allowing you to use white-space:normal instead for better display compatibility.

Network handling

Build a TCP Server Using the New TCPListener Class

With 4D 20 R9, the introduction of the TCPListener class allows you to handle incoming TCP connections, complementing the TCPConnection class from 4D 20 R8.

Together, these classes enable server-to-client TCP connections, providing complete flexibility to build a TCP server in 4D. You can now easily listen to a specified port, accept incoming connections, and manage data interactions between server and client.

4D Component

Edit and Debug Component Code Inside the Host Project

Edit and debug component code directly within your host project in 4D 20 R9, without switching environments.

Simply double-click to open and modify component methods or classes in the standard editor. Step directly into editable methods and apply changes instantly without reloading the project to speed up debugging.

Dependency Manager

Automate Dependency Compatibility with Follow 4D Version

The Follow 4D version rule simplifies dependency management by automatically syncing your dependencies with your 4D environment. This reduces compatibility issues and saves you time.

  • Automatic Compatibility: Dependencies align with your 4D version, no manual tracking needed.
  • Effortless Updates & Downgrades: Dependencies update automatically when upgrading or downgrading 4D.
  • Reliable Dependency Resolution: The system resolves dependencies based on structured tag naming conventions for LTS and R releases.

 

HTTP Server

Securely connect your Web Apps to Third-Party Systems

Leverage 4D 20 R9’s OTP and session restore features to build secure web applications that efficiently handle third-party integrations.

Use the createOTP() function to generate and share a One-Time Passcode, ensuring safer interactions with third-party systems. This eliminates the risk of security breaches while preserving user context through multiple steps, like account creation or product registration.

The restore() function further simplifies the process by restoring the session using a secure OTP, enabling smooth, uninterrupted user journeys.

Web Area

Use a Class in Embedded Web Areas with $4d

Control access to 4D methods in your web areas by defining exactly which functions are exposed through $4d. With the new WA SET CONTEXT command in 4D 20 R9, you can encapsulate and restrict available functions using class methods or object-based contexts—enhancing security, improving code organization, and simplifying maintenance.

User Interface

Improve Formula Editing and Security in Label Wizard

4D 20 R9 improves the Label Wizard component, making it easier and safer to insert and modify formulas in your labels. Now, you can quickly add formulas using a dedicated button or menu item, and validate them directly in the Formula Editor.

This update enhances security by filtering out malicious formulas and ensures the creation of valid formulas by blocking disallowed commands. Editing is simplified too—just double-click to open the formula and make changes.

 

4D View Pro

Import Documents Reliably with Custom Function Support

4D 20 R9 ensures that import commands like VP IMPORT DOCUMENT and VP IMPORT FORM BLOB only execute callbacks once all custom functions are fully processed.

This provides greater control and reliability when importing documents, ensuring calculations are completed before actions like printing or saving.

Additionally, the VP FLUSH COMMAND now accepts asynchronous callbacks that are invoked once all pending calculations are complete, giving you full control over what happens after formula evaluation—without blocking operations.

This update simplifies handling documents with custom functions, saving you time and reducing errors in your workflow.

Code Editor

Get Warnings for Deprecated Language Elements

In 4D 20 R9, deprecated language elements such as commands, constants, parameters, and typing directives now trigger warnings, helping you keep your code modern and efficient. Deprecated elements like C_LONGINT($1) or _O_USE INTERNAL DATABASE will prompt these warnings, and while they can still be used, they are no longer suggested in code completion.

You can disable these warnings through structure settings.

Additionally, the Command name command now includes deprecation information, providing a simple way to check for deprecated commands. 

 

4D Netkit

Use Host Web Server to Simplify OAuth 2.0 Setup

With 4D 20 R9, OAuth 2.0 authentication is easier and more efficient. It allows you to use your host web server’s address and ports for authentication responses, removing the need for port conflict management and easing the process.

You can now rely on your existing host server configuration, improving security while simplifying setup.

Plus, 4D NetKit intelligently handles which server to use based on your redirect URI, making the process more straightforward.

If using the host server, simply add an HTTP handler to manage responses, reducing configuration effort and increasing reliability.

Manage Google and Microsoft 365 Calendars with ease

With 4D 20 R9, managing Google Calendar and Microsoft 365 events is simplified through the new cs.NetKit.Google and cs.NetKit.Office365 commands. You can easily retrieve calendars and events by establishing an OAuth 2.0 connection and using the calendar.getCalendars() and calendar.getEvents() functions. This update makes it easier to integrate and manage calendar data in your applications without the need for complex setups.

Build application

Defining the 4D built Application UUID for macOS

Guarantee proper macOS behavior and better system integration by giving each built 4D application a unique UUID. Starting with 4D 20 R9, built apps no longer share the same UUID as their source, improving control over system permissions like network access. You can also retrieve or customize these UUIDs using the updated File.getAppInfo() and File.setAppInfo() functions, offering more flexibility during deployment.

Licenses

Enable Auto-Refresh for OEM Build Licenses

With 4D 20 R9, OEM build licenses now refresh automatically when expired. Simply sign in through the Welcome Wizard; licenses will update without manual intervention. When upgrading to a new version, both development and OEM build licenses are refreshed together. You can also manually trigger a refresh via the License Manager.

 

Want to know more? Read all the blog posts about 4D 20 R9