What’s new in 4D v20 R2

4D Write Pro Tables

Table Wizard to create a table with data

Over the last few versions of 4D Write Pro, many table-related features have been added. You can easily create tables based on database data using contexts, data sources, and formulas.

Recognizing the potential challenges users face without extensive training in formatting data sources or formulas for various table components, we have introduced a robust solution in 4D v20 R2: the table wizard.

The table wizard is a user-friendly tool accessible to end-users, allowing them to take full advantage of developer-provided templates tailored to their specific use cases and business requirements. When configuring templates, users can perform the following actions:

  • define tables and fields,
  • translate table, field, and formula names,
  • prepare formulas adapted to the business,
  • design graphic styles.

 

Cells merge

And speaking of tables, they are vital in organizing and presenting information within 4D Write Pro documents. With the introduction of 4D v20 R2, an exciting enhancement has been made to facilitate better organization and presentation of data in tables: the ability to merge cells. Because regardless of how you utilize tables, whether they are populated automatically or manually, the option to merge cells offers significant benefits.

The cells of the tables can be merged horizontally on all or part of a row or vertically on all or part of a column. It’s also possible to create blocks of cells.

This can be done either:

  • Via the user interface: Two buttons are now available in the toolbar, and two menu items in the cells button menu in both interfaces (toolbar and sidebar).
  • Standard actions: Two are available, “cell/merge” and “cell/split.” 
  • By programming: two new dedicated commands have been created so that you can define how their cells should be arranged for each table you create. WP TABLE MERGE CELLS and WP TABLE SPLIT CELLS.

Programming-related features

Enhanced error management

Starting from 4D v20 R2, throwing errors in your 4D code is now possible. These errors function like any other 4D error, triggering an error dialog or being handled in an ON ERR CALL method. This feature relies on a new throw command.

This new capability allows you to elevate user feedback by providing comprehensive and timely information directly within your interfaces. By promptly detecting errors as they occur, you can offer end users more detailed explanations, resulting in an improved user experience. Additionally, you can implement more effective error logging.

 

Websocket client

In the present-day interconnected world, the demand for real-time updates is crucial for websites and IoT applications.

One method of delivering instantaneous information to your websites or applications is utilizing the Websocket protocol, which establishes a full-duplex communication channel between a server and a client. As of 4D v20, you can create a websocket server using the 4D.WebSocketServer class. With 4D v20 R2 the 4D.WebSocket class enables you to create a websocket client to connect to your server.

Note: If you’re interested in knowing more about the subject, don’t miss out on Thomas Maul’s session on the WebSocket Server, organized by 4DMethod.

 
 

Visual Studio code extension

Format your 4D Code in Visual Studio Code.

With the release of 4D V20 R2, the VS Code extension has introduced a new feature: code formatting!

If you’ve been using VS Code to edit 4D methods or classes, you might have noticed that the code formatting didn’t match the style used in 4D. However, now you can format your code like 4D does. This means the VS Code extension behaves consistently with other programming languages regarding code formatting.

 

4D Netkit

Enhancement of OAuth2 Authorization

With 4D v19 R3, connecting your application to the Microsoft Graph API through OAuth 2.0 has become incredibly convenient using 4D NetKit. 

With 4D v20 R2, you can seamlessly obtain an OAuth 2.0 token for Google API or other OAuth 2.0 servers. A new feature has been introduced to further enhance the integration of this authentication process into your application. This feature lets you directly display your HTML page in your web browser once the token is received, ensuring a smoother and more streamlined experience.

 

Send an email with the Gmail API.

We understand the significance of email communication and recognize that sending emails is a frequent requirement in modern applications. Many Gmail users have expressed their need for an API that simplifies sending emails via the Gmail API. To establish a connection with the Gmail server, OAuth 2.0 was essential to establish a connection with the Gmail server.

We are delighted to announce that we are stepping into Gmail email management and embarking on developing a ‘send email’ command as our initial implementation.

 

4D View Pro

New format file: sjs

We are aware of the performance challenges that can arise when working with larger and more intricate 4D View Pro files. To address this, we have introduced a new file format called .sjs.

The .sjs format is designed as a compressed file that consists of multiple smaller JSON files, following a structure similar to Excel XML. This innovative format has been developed with the goal of improving performance and optimizing the handling of these files, particularly for scenarios involving complex 4D View Pro files.

This new format can be imported and exported just like the .4vp files, with the VP IMPORT DOCUMENT and VP EXPORT DOCUMENT commands.

 
 

Improved Network Communication (QUIC)

Activate QUIC Layer from the Structure, User, and Database Settings

The new QUIC network layer was introduced with 4D v20 beta. As the layer is still in beta, we deactivated it for the LTS final release. The QUIC layer will be available in the feature releases, so you can follow its development and help us improve it.

While 4D v20 allowed switching network layers only in interpreted applications and forced a new build for engined applications, 4D v20 R2 allows layer changing in compiled/build applications via the Structure, User, and Database Settings to facilitate testing even in production.

Want to know more? Read all the blog posts about 4D v20 R2