What’s new in 4D V17 R5




4D v17 R5 introduces new built-in data encryption for your 4D databases. Data can be encrypted via code or the user interface, for all tables or only selected tables. 4D’s encryption tools are based on a passphrase. It’s composed of a sentence or a combination of words which is used to generate a binary encryption key to encrypt data with the AES algorithm. In order to work with an encrypted data file, the passphrase or the binary encryption key is mandatory.

It’s important to note: If you lose the encryption key, there is NO workaround. The data will be locked forever!


Encrypt via the MSC

A new Encryptable attribute is available for tables in Design Mode. It sets the encryption status of a table by designating that it can be encrypted. Once you’re ready to encrypt your data, the easiest way to do so is via the new Encrypt page in the MSC. This page provides all of the necessary features to monitor your data encryption. You can use this page to encrypt or decrypt the data file, as well as re-encrypt it and/or change your passphrase.



Encrypt with 4D commands

In addition to the MSC, 4D v17 R5 includes a set of commands that are designed to support most encryption requirements. For example, you can manage encryption with the Encrypt data file() command, or use the provideDataKey() command to provide the data encryption key to an opened data file. You can even use the encryptionStatus() to check whether or not the opened data file is encrypted and if a valid data encryption key has been provided. The complete list of commands is available in the Doc center.


4D for iOS – Preview 


Actions are now available with 4D for iOS which allow you to have more interactivity with your mobile app. These actions let your users set tasks to completed or finished or mark events to be checked, with just the swipe of a finger or by selecting an action from a menu. A new On Mobile App Action database method is available which lets you declare all of your actions. In addition, an Action section has been added in the Project editor so you can define your action elements (Name, icon, short/long labels, tables, and scope).


Incremental data synchronization

With 4D v17 R5, 4D for iOS includes incremental data synchronization. This means that instead of continuously sending the entire data set to a device, 4D now automatically keeps track of updated or deleted records and only updates this data on the device. Plus, your data is not only updated each time you launch your app, but also each time your app goes to the foreground or in response to an user action. 


N to one relations

In 4D v17 R5, 4D for iOS supports N to one relations. You can use descriptive relation names and simplify defining your project structure. Change a related fields’ short and long names, choose its icon, and apply queries on it.


Sending Emails 


Log SMTP conversations

4D v17 R5 provides a new feature for email logs: the SMTP New transporter command. It creates a connection between an SMTP server (such as exchange or gmail) and the client, and logs – in plain, non encrypted text – all of their communications. A new property logFile is available, containing the full path of the log file defined for the SMTP connection. The file can be produced in two versions: A standard version and an extended version. Both versions can be triggered by the SET DATABASE PARAMETER command.


Custom mail headers

4D v17 R5 provides five new predefined headers directly via the mail object:

  • messageId: Single, unique message identifier that refers to a specific message version.
  • inReplyTo: Message identifier of the original message to which the current message is a reply
  • references: Collection of message identifier(s) of other message(s) to which the current message may be related.
  • keywords: Object containing important words and phrases that might be useful for the recipient.
  • comments: Contains any additional comments about the text of the message body.


If you need other headers, use the headers collection to add specific SMTP header to your email.


Legacy charset support

With 4D v17 R5, you can use legacy encodings to send email: ISO-2022-JP for Japanese or ISO-8859-1 for Western European. The SMTP New transporter command accepts new parameters which allow you to specify the type of encoding you want to use in your header or body.





Named placeholders for values

4D v17 R5 makes it easier to write generic ORDA queries thanks to named placeholders for values. These placeholders are provided as object parameters in the query settings and replaced by another value when the query string is evaluated. 


Named placeholders for attribute paths

You can also use placeholders for attribute paths (fields names in tables). Two types are available: Indexed – inserted as :paramIndex (e.g. :1, :2,… with an increment of 1) in the query string and their corresponding values are provided by the sequence of value parameter(s), and  Named – inserted by as :paramName and their values are provided in the attributes or parameters objects in the query string. 



Performance optimization in Client/Server mode 

Accessing large tables (especially those with relations) in Client/Server mode using ORDA has been greatly enhanced in 4D v17 R5. When using entity selections in list boxes or in code loops (e.g., While or For each) the fields used will automatically be analyzed to optimize the network transfer. You’ll see 2-3x improved LAN performance and up to 30x faster in WAN (depending of the network and record size). And best of all – there’s no need to change anything in your code, it’s all automatic. 


 Significant Improvements



Enhanced performance

In heavily used servers (e.g., many parallel users or processes accessing records, while other users modify/create records of the same table), an improved internal locking mechanism can drastically improve performance. This can lead to significantly faster speeds (4-8xs) with higher CPU usage, as threads spend less time waiting for micro locks.


Librairies update

Because 4D v17 R5 is 64-bit only, multiple libraries have been updated: Hunspell v.1.7.0 (spell checker), PHP v7.3.1, CEF 3626 (Chrome Foundation, internal web area), OpenSSL v1.1.1 (allowing the support of TLS 1.3), and ICU 63.1 (new Unicode versions. This update will cause an automatic reindexing of text, alpha, and object fields).


Multi-client instances

With 4D v17 R5, you can run multiple clients on the same computer and simultaneously connect them to the same 4D Server. Each client connection now includes a separate cache folder containing the connection’s IP address, port, and a hash code. Thanks to this, you can also connect several clients from the same machine to multiple servers on different machines. No configuration necessary.

Enhanced UI in Quick Report

The Quick Report user interface has been enhanced with a “Save / Save as” button and a tooltip. Choosing “Save” saves your work by updating the last saved version of the file to match the version on your screen. Choosing “Save As” prompts you to save your work as a file with a different name. The addition of a tooltip allows you to view the sorting direction: ascending or descending.


4D Language


Read 4D object fields with SQL Engine

The SQL engine in 4D v17 R5 has been updated to allow reading 4D object fields. To browse the content of an object field, the SQL CAST function has been extended to return a JSON representation of the field.


Object notation to handle files and folders

4D v17 R5 provides commands to handle files and folders via object notation. A new Folder command has been added which lets you create a folder object from a constant, a POSIX path, or a platform path. The folder object has properties (e.g., name, modificationDate, modificationTime) and methods (e.g., create(), moveTo(), rename(), delete()) that enable the creation and manipulation of folders. As with folders, the File command is available to handle files. The new file object allows accessing and manipulating file attributes. You can use file methods to write and read the contents of a file, move it, delete it, etc.


More information about web processes

New information about the URL used by web processes is available with 4D v17 R5. This information can be retrieved two ways: via the 4D Server Administration Window or via the 4D language with the Get process activity command; a new “url” attribute is added to the process object when the process type is a web process.


Define an alternate name for 4D user account

A new command is available to define a custom name to use in place of the current 4D user account name: SET USER ALIAS. It accepts a string as parameter. That string (alias) will replace the 4D user name in the 4D environment. This command can only be called from 4D remote or 4D single-user applications, not on 4D Server. An alias enables using your own user/password system, or an external user directory such as Active Directory or LDAP while still benefiting from all of 4D’s built-in user identification concepts.


Debug log improvements 

With 4D v17 R5, the SET DATABASE PARAMETER command is enhanced to allow logging only specific processes, as well as calls to member methods (collection or object methods). A new selector is available (Current process debug log recording) which launches debug logging of the current process and creates a file named “4DDebugLog_pX_Y.txt” in the 4D logs folder (where X is the process PID and Y the sequence file number). To log member methods, use Debug log recording or Current process debug log recording selectors which accept a new option with the value 32.




4D Write Pro

Links to 4D methods

4D v17 R5 includes the new command, WP SET LINK. It allows you to set URLs, and also gives you the ability to invoke a method from your 4D application (with parameters) or target bookmarks from your document. The new WP Get links command returns a collection of all the links in a document, in a single call. Each link of the collection is an object with a description of the link in its attributes.


Tab settings

As of 4D v17 R5,  tabs can be set with a collection of strings, numeric values, or even a collection of objects! If you only need to modify the default tab values, you can use an object with the new wk tab default constant (added specifically for this purpose).


Handle the view properties by programming

With 4D v17 R5 you can handle the view properties by programming. TheWP SET VIEW PROPERTIES command allows dynamically setting one or more view properties of the 4D Write Pro area. The settings can be returned in an object with all the view properties via the WP Get view properties command. 


More targets and renamed commands

The commands listed below have been extended in 4D v17R5 to accept any kind of target as first parameter. They can still use a range, but now they can also use a reference (header, body, footer), an element (picture, paragraph), or the entire document as target:

  • WP Insert table


Also, several commands have been renamed:

Previous name New name
WP Create Paragraph range WP Paragraph range
WP Create Picture range WP Picture range
WP Create range WP Text range
WP Create Table range WP Table range
WP Get bookmark range WP Bookmark range
WP Get selection WP Selection range




4D View Pro

Ribbon-style toolbar

4D v17 R5 provides a powerful, ribbon-style toolbar to enhance the 4D View Pro user interface. It allows you to organize 4D View Pro features into a set of tabs, to increase the discoverability of functions and enables quick access to different commands. It’s worth mentioning that this toolbar also introduces new functions such as PDF and CSV export options.


Manage selections and active cell

With 4D v17 R5, we’re including a set of commands to help you set and get the active cell or selection(s) in your documents:

  • VP Get active cell
  • VP Get selection


And if you want to view a cell in a specific position in your 4D View Pro area (e.g., top left or bottom right), you can use VP SHOW  CELL command.



Want to know more? Read all blog posts about 4D v17 R5