4D v20 Beta Starts Today

We’re excited to announce that beta testing for 4D v20, one of our most anticipated LTS versions yet, is starting today!

With over +100 advances, including enhancements to existing products and highly requested features that have been voted for by our 4D developers, this release promises to be one of our most comprehensive and feature-rich releases yet.

Buckle up, and let’s discover some of what 4D v20 Beta has to offer:

 

  • Build real-time web applications that can handle large volumes of data and provide a seamless user experience with the new built-in WebSocket Server.
  • Work with complex data structures with object and collection literals that provide a more concise and readable way to initialize objects and collections in your code.
  • Quickly and efficiently search and replace code with the Find and Replace feature improvements.
  • Create a custom “Help” menu for your application by passing a collection describing the menu items.
  • Save time and quickly analyze and organize your data with 4D Write Pro’s tables, which automatically fill your data in tables with page breaks, headers, footers, and even break rows.
  • Take advantage of 4D Write Pro text boxes (floating containers) to print complex product flyers or brochures.
  • Evaluate the new feature, QUIC Network layer, a total rewrite of Client/Server communication. Built on UDP instead of TCP, it facilitates faster recovery in case of packet loss, congestion, and other issues that can cause delays and disruptions in network traffic.
  • Native support for Microsoft 365 using the Microsoft Graph API allows sending, receiving, organizing emails, and handling user authentication with Single Sign On (OAuth2)
  • Much more awaits you with this LTS (see below)

Download 4D v20 now (Exclusive to 4D Partners)

4D Language and Beyond

NEW BUILt-IN WEBSOCKET SERVER

WebSocket protocol provides a persistent, full-duplex communication channel between a client and a server. It enables real-time data transfer between the two parties and allows faster and more efficient communication.

4D v20 now includes a built-in WebSocket server, allowing developers to build real-time web applications that can handle large volumes of data and provide a seamless user experience.

This opens up a world of possibilities for real-time data visualization, collaborative applications, and IoT applications that require instant updates.

Object and collection literal initializer

Objects and collections can be initialized in your code using New object and New collection commands.

4D v20 introduced a new and more readable syntax to initializing large or complex objects and collections in your code – the object literal and collection literal.

With object literals, you can initialize an object with its properties and values enclosed in curly braces {}. For example, instead of using the New object command, you can create a new object and initialize its properties in a single line of code like this $object1 := {a : “foo”; b : 42+26; c : {}; d : [“coucou”; “rien”]}.

Similarly, with collection literals, you can initialize a collection with its elements enclosed in square brackets [].

Meet the Improved Distinct Function

The distinct function of the Collection and Entity selection classes allows retrieving a list of unique values.

With 4D v20, you can also retrieve the number of occurrences of each distinct value. This functionality can be beneficial when working with large datasets and needing to analyze the frequency of specific values.

Declaring Class Properties

4Dv20 brings you a new feature that will ease the use of your classes: declared class properties. Declaring your class properties will significantly improve autocomplete and give you meaningful errors when compiling. Declaring a class property is easy; it uses the same syntax as declaring variables but with the keyword property: property myProperty : text.

Comparison with an Undefined Value

With the introduction of ORDA and other objects in 4D, developers often work with undefined values, sometimes leading to errors when comparing them with different values.

Starting with 4D v20, a new improvement was introduced that allows developers to compare any type of value with an undefined value without throwing an error. This means you can now safely compare undefined values with others without worrying about causing an error in your code.

Passing form object to Print Form and FORM LOAD commands

With 4D v20, the Form command is supported with Print form and FORM LOAD. Form, with previous versions available for DIALOG or subforms, allows drastically reducing the need for process variables and writing more portable and isolated code. This a welcome improvement to 4D that will undoubtedly make developers’ lives easier and more productive.

Custom Help Menu

With 4D v20, you can create a custom “Help” menu for your application by passing a collection describing the menu items. This, for instance, allows you to provide your users with easy access to documentation, support, and other helpful resources.

New commands to lock the datastore

4D provides you with multiple built-in ways to back up your data: 4D backup and the use of a mirror server. With 4D v20, 4D exposes internal commands to lock the datastore, allowing you to copy your data while 4D is running. Say hello to ds.flushAndLock(), ds.locked(), and ds.unlock().

Automatic integration of multiple journals

4D v20 introduces a powerful new feature that can significantly improve your productivity during database maintenance operations. By automatically integrating multiple journals at database startup, you can focus on developing your application rather than spending time on manual database management tasks.

To take advantage of this feature, simply ensure that the “Integrate last logs if the database is incomplete” setting is activated, which is the default. Then, place the journal files you wish to integrate next to the current one. 4D will automatically detect any missing operations in the startup database and check all journal files to determine if recovery is possible. If there are no problems, it will integrate the operations from all of the journals without any intervention required on your part.

Introducing the Latest Find and Replace Features

The “Find and Replace” feature in the code editor has existed for many years. Developers can quickly and efficiently search and replace code, especially when dealing with large codebases. 4D v20 is bringing improvements that are sure to be appreciated by developers who rely on this functionality to streamline their coding workflows:

  • knowing the number of occurrences to replace,
  • knowing the position of the current occurrence,
  • having permanent access to the Next and Previous navigation options,
  • display a palette instead of a modal window to limit the number of clicks.

Build an application with 4D commands

4D has continuously added new features to help developers create their own build chain, providing greater flexibility and customization options for their applications. These features include the ability to create a “.zip” folder, add additional information such as the copyright on an executable or a “dll”, and create an “info.plist” file.

With the release of 4D v20, two new features have been added to make the process of creating standalone or client/server applications even easier:

  1. Adding an Icon to an Executable.
  2. Generation of Deployment License File.

PDF format for Print Previewing on Windows

PDF format is a viable alternative to XPS for print previewing on Windows, providing users with a more accessible option. Microsoft’s decision to make the XPS Viewer an optional Windows feature has caused issues for many users when deploying applications, resulting in end-users being unable to preview their printings. Although installing the free XPS Viewer is straightforward, some administrators are hesitant to install additional features, particularly on Remote Desktop environments.
Fortunately, 4D v20 now offers the option of using the PDF format for print previewing. Since almost all current Windows versions have either XPS or PDF pre-installed, end-users should no longer encounter issues with print previewing. This new option offers a more flexible and efficient solution that meets the needs of both end-users and administrators.

A tool for 4D code execution in CLI

4D v20 brings a new application called tool4d. This application is a subset of 4D designed for your build chain to automate the build process and is dedicated to headless script execution through Command Line Interface.

AND MUCH MORE…

4D v20 contains over 30 new features to ease your development process, including statements & operators (e.g., && and ||, return, break, and continue) to reduce your code footprint, the possibility to define a global error handler that will be efficient for all execution contexts, downloading Local Resources to a shared folder with the Windows Remote Desktop Services instead of the user account folder, a new command that gives all the information about your license usage, launch external process asynchronously, automatic row height in list boxes based on collections and entity selections. For those who still develop in binary mode, you can now develop concurrently on a 4D server in Project Mode, which means you can adopt Project Mode without impacting your development organization and benefit from its exclusive features: Silicon compilation, CSS forms, classes, computed attributes, and when you are ready, source control systems.

 

4D-Analyzer extension

New features in the Visual Studio Code extension

This extension got much attention from our 4D developers, and we couldn’t be happier!

4D brought Visual Studio Code code editor support, allowing it to handle 4D code and provide it with standard functionalities such as syntax highlightingGo To Definition, Signature Help, and code completion.

4D v20 brings new capabilities to the Visual Studio Code editor through the 4D-Analyzer extension: Say hello to code folding and syntax checking.

AND MORE for the code editor…

The 4D code editor we all know and love got its share of features: the list of functions in your class is displayed in the code editor toolbar, allowing you to quickly jump to a specific function. Simplified navigation between code, documentation, and explorer. Better organize your comments with comment tags. Improve your productivity with object check syntax; a warning is displayed in the code editor if you call a function that does not exist. The possibility to customize the code editor for better organization. And the opportunity to access the details of a class function without having to search on the documentation site.

 

 

4D Write Pro

4D Write Pro has dramatically improved over the last few versions. In fact, we, the 4D team, are invested in making 4D Write Pro a potent template-based document generator, eliminating the need for manual document creation and reducing the risk of errors.

With 4D Write Pro, you can automatically feed and generate pre-filled documents with contextual information, pulling data directly from the 4D database. This includes information such as names, dates, address information, and numbers, among other types of data. 4D Write Pro then merges this information with your templates, providing a streamlined and efficient document creation process.

In previous releases, we introduced powerful features such as headers, datasources, and carry-over rows, to name just a few. These features have been well received by our users and have further enhanced the capabilities of 4D Write Pro.

With the release of 4D v20, we are proud to introduce two new additions to the already impressive list of features:

4D Write Pro & Text Boxes: docx Import/Export Options

Text boxes allow you to insert a floating container, including text, tables, images, formulas, and other elements anywhere in your document. This feature has been improved in v20 to include exporting and importing these elements from and to docx documents.

Tables’ Break Rows

Whatever your activity is, you certainly need to create lists. These lists are sorted according to your own criteria, and it is usually necessary to create groups for each of these groups to obtain totals or statistics.

With this feature, you can create groups within your lists, allowing you to quickly obtain totals or statistics for each group. For example, if you have a list of sales data, you can group the data by month or by salesperson to see the total sales for each month or for each salesperson.

This feature can save you time and make analyzing and organizing your data easier.

AND MUCH MORE…

As stated earlier, the 4D Write Pro features set has grown even more with 4D v20: headers, data contexts, the possibility to define a “datasource” for the tables of 4D Write Pro, carry-over rows, a document change detection feature, user-friendly display of formulas, disable visibility of empty images. And much more.

 

 

Data Explorer

Display data explorer in the main toolbar

 

The 4D Data Explorer is a web browser interface usable by the administrator and the developer remotely (securely with an HTTPS connection) or locally on the same machine as your opened database.

This product gives developers and administrators powerful tools for managing and analyzing data in 4D databases, making finding and fixing issues and improving performance easier.

With 4D v20, the Data Explorer now offers two significant enhancements.

The first feature allows you to visualize the relations between your data, making browsing and locating relevant information within your database easy.

The second update is the addition of an icon for the Data Explorer in the toolbar, making it even easier to open it in 4D instead of an external web browser. Users can access the Data Explorer directly from the toolbar with just one click, saving time and improving productivity.

 

ORDA

Starting with 4D v20, ORDA makes it possible for you to:

  • REST server: Handle user permissions thanks to a robust system to protect your data from unauthorized users. A system to protect your data depends on who is accessing it and which data is accessed.
  • Better control over the ORDA contexts and cache for both Client/Server and REST to improve performance.
  • Computed attributes that allow you to separate business logic from the UI.
  • Aliases are the logical and complementary continuation of computed attributes, making development faster and easier. An example usage is to give easy access to related attributes (which means hiding the complexity of a related database).
  • Full support of the BLOB type.
  • Inspect and compare two entity selections thanks to the function available on the entitySelection object: the selected() function.

 

Note: Interested in ORDA but don’t know where to start? Plenty of resources are available to guide you from beginner to expert level. We gather them all in a single post to make it even easier for you. Read the guide

 

 

Improved network communication

Meet QUIC

As the number of simultaneous connections to the most significant production servers running on 4D continues to grow, ensuring optimal performance has become a top priority for development teams. The QUIC protocol has emerged as a promising solution to address this challenge.

QUIC is a protocol designed to enhance speed and performance in server-side networks. Developed by Google over the last decade, QUIC leverages the benefits of UDP instead of TCP to enable faster recovery in case of packet loss, congestion, and other issues. QUIC is today heavily used, for example, in HTTP/3 as “HTTP over QUIC” and supported by all major browsers, already used in more than half of all connections to Google’s servers. Facebook handles more than 75% of its internet traffic using QUIC, and many apps, such as YouTube, Gmail, or Uber, are using QUIC to communicate with their servers.

While QUIC is still considered an experimental feature in 4Dv20, you can evaluate its potential benefits by testing it on your infrastructure. We encourage you to try QUIC and provide us with your feedback to help us improve and refine this exciting new technology, paving the way for its inclusion in future releases of 4Dv20. And remember that QUIC can enhance the resilience of the 4D infrastructure, making it better equipped to handle bad connections and other network challenges.

 

 

Mail Features

POP3: Download the Mail Header Only

When retrieving email messages using POP3, it’s possible to retrieve just the message headers (which include information such as the sender, subject, and date) without downloading the entire message body.

Retrieving just the message headers can be helpful when you want to quickly scan the list of messages in your mailbox to decide which ones to download and read in full.

Starting with 4D v20, a new parameter is added to the POP3Transporter.getMail() function to receive your emails without the body. 

IMAP: Mailbox Id and mail keywords

4D v20 brings two handy features to IMAP Transporters:

The first feature is the ability to manage custom email keywords when interacting with specific IMAP mail servers and clients. Custom keywords allow you to tag emails with particular labels or categories, making it easier to organize and find them later. With this new feature in 4D v20, you can add, remove, or list custom email keywords using the IMAP Transporter.

The second feature is mailbox ID support in the IMAP Transporter. When you work with IMAP mailboxes, they can be renamed or moved, making tracking difficult over time. With the mailbox ID support in 4D v20, you can identify a specific mailbox even if it has been renamed or moved. This can be useful for keeping track of essential mailboxes, such as ones that contain archived messages or messages from specific senders.

Microsoft365: folders management

Microsoft is deprecating Basic authentication for IMAP and POP3, which means that users will need to use a more secure authentication method to access their email data. The Graph API is a more secure and modern way to access data in Microsoft 365, including email data.

With the new functions in 4D NetKit, you can now manage (create, delete, rename, and get information) by programming your mailboxes using the Microsoft Graph API.

AND MUCH MORE…

4D NetKit has several commands to manage your emails through the Microsoft Graph API. Commands to: send and receive emails and list your mailbox folders, move an email from one folder to another, reply to an email and create a conversation, create a draft email and save it in the folder of your choice, and delete an email.

Also, 4D NetKit allows you to be part of the Microsoft Azure-based Active Directory, enabling users to log in to your application using their usual company credentials. Besides allowing Single Sign-On, it will help retrieve information on an authenticated user, such as email, department, and phone number.

And following the introduction of OAuth 2.0 authentication to access emails through IMAP, SMTP, or POP3 transporters. 4D continues to implement the OAuth 2.0 protocol with 4D v20 and provides a way to quickly request authentication tokens from the Microsoft identity platform to connect to the API for Microsoft 365.

 

4D View Pro

4D v20 introduces an exciting feature: data contexts, a great way to load your data and build your templates. It lets you create your document with placeholders and fill it in by setting this data context. This means you can automatically populate business content with the correct information for every situation— be it reports, invoices, contracts, or any other document type.

Another feature worth checking is pivot tables. If your users include people from sales and marketing, this feature is worth a try, as it allows you to easily summarize and analyze data directly from the 4D View Pro ribbon.

4D v20 also will enable you to import and export CSV files. And gives you enhanced printing capabilities to ensure your worksheets look good on paper with the available print settings.

Also, many commands are available to:

  • Manage the sheets in your 4D View Pro documents by programming.
  • Handle page breaks from the UI tanks to new entries in the contextual menu: “Add page break” and “Remove page break.” 
  • Fine-tune your user experience by hiding the sheet tabs, and the scrollbars, deactivating the context menu, or the drag-and-drop action.
  • Copy/cut and paste a range of cells in another location to speed up your development process.
  • Benefit from additional table properties like headers, table resize, summary row, column sorting, filters, and more.
  • Manage your table columns and rows more efficiently — by adding or removing columns/rows depending on end-users needs.
  • Apply by programming one of the over 60 predefined table styles. If none of these styles meet your need, you can define your theme and apply it to your table.

 

Need more technical details? Look at the 4D v20 Beta documentation in the 4D Doc Center.


Your feedback is greatly appreciated, and it will help us improve our product to better serve your needs. We’d love to hear your thoughts about any of the features. Contribute to our “beta version” forum (accessible to all 4D Partners). Not a partner yet? Become a 4D Partner and join the conversation!

Avatar
• Product Marketing Manager • Intissar joined 4D in 2017 as a Product Marketing Manager. She works closely with the product, marketing, engineering, and technical support teams to highlight the ‘why’, the ‘how’, and the ‘what’ of new and updated features to different audiences. This close proximity allows her to craft messaging frameworks and write in-depth content and code samples for the 4D blog and website. After graduating with an engineer's degree in Computer Science from VINCI university, Intissar worked in several startups as a software engineer. Her hands-on experience includes software specification, design, and development, user training and support, and team management.