What’s new in 4D v18 R4

ORDA Classes

ORDA makes it possible for you to create high-level class functions above the data model. This allows you to write business-oriented code to hide complexity, reduce errors, and speed up the development process. Additionally, you can expose your project just like an API with a REST server.

ORDA Classes to handle the data model

ORDA’s structure (datastore, dataclass, entity, entity selection) is made up of strongly-typed objects linked to specific ORDA classes. This means that you can write functions that hide the complexity of your data’s physical implementation. 

ORDA classes are automatically available with application projects. 4D automatically creates:

  • DataStore: For implementing functions related to the datastore
  • DataClass class: For implementing functions related to the dataclass
  • Entity class: For implementing functions related to an entity
  • EntitySelection class: For implementing functions related to an entity selection

 

ORDA Data Model Classes and REST

You can call class functions defined for the ORDA data model through REST requests in order to benefit from the exposed API of the targeted 4D application project. Please note that functions must always be called using REST POST requests.

 

Programming-related features

Server code development 

Developing and debugging server code in project applications becomes easier. To save time and avoid having to restart your server application after a code modification (in standalone mode), now when you connect a 4D Remote on the same computer as the 4D Server, the remote is able to modify the project files (code, forms, resources, etc.).

When a 4D Developer client connects to a 4D Server on the same computer, the .4DZ file is not transferred from the server to the client. The 4D Remote manages the project files (methods, forms, resources, etc.) as if it were a 4D single-user client. The project files are shared by 4D Server and 4D Remote. This way, you can modify your code and test it on the fly.

If you want the server to reload the modified files, switch from the development environment to application mode, move the 4D Server to the foreground or select the “File / Save all” menu item in the 4D Remote (or use the new RELOAD PROJECT command).

Remember that running a method on the client-side automatically performs a “Save all” action, and as a result, it reloads the modified files on the server-side.

 

Access form object values by programming

Two new commands are available to help you access the values of form objects, regardless of its variable or expression: OBJECT Get value and OBJECT SET VALUE. To get the value of a form object, use the OBJECT Get value command and pass the name of your form object as a parameter. In the same way, if you need to set the value of a form object, use the OBJECT SET VALUE command and pass the name and the new value as parameters.

 

New declaration syntax 

A new syntax to declare your variables is now available. It uses the var keyword, the name of the variable, and its type. The new syntax allows you to greatly enhance autocompletion when declaring your variables. You can declare variables using both the classic and new syntax in the same database.

 

Support for Cross-origin resource sharing (CORS)

The CORS protocol prevents a web page from making requests to domains other than its own. However, if you need to allow other sites to make HTTP requests to your server in order to get or send some data… now you can via:

  • programming: thanks to the WEB SET OPTION and WEB Server commands. They take in domain parameters to allow specific actions (GET, POST, HEAD, PUT) 
  • database settings: thanks to options available on the Settings> Web > Options (II) window.

 

Listbox

availability of Pro list box features

You no longer need to have a 4D View Pro license in order to use advanced features such as list boxes. They’re now free! There’s nothing stopping you from taking advantage of list boxes that can:

  • automatically adapt the height of each row to its content (so that the full text or picture can be displayed),
  • use object arrays in columns (so you can enter and display various types of values in the rows of a single list box column). 

 

Set up movable rows by code

In the case of array-based list boxes, you can define (in Design mode) if end users can move rows (e.g., to reorder or group rows, etc.). The LISTBOX SET PROPERTY and LISTBOX Get property commands have been updated to support a new property: lk movable rows.

 

Administration

Dynamically grant user permissions

Following the ability to use your own end-user management system and the SET USER ALIAS command, we’ve added the ability to manage end user permissions. The new SET GROUP ACCESS command lets you dynamically set group memberships. 

Email

Receive emails using IMAP

In 4D v18, we introduced a new way to send emails. Then in 4D v18 R2, we added a new way to retrieve emails using POP3. Now in 4D v18 R4, we’re taking the first steps for a new way to handle the IMAP protocol. As we did for SMTP and POP3, there’s a new IMAP New transporter command to handle the IMAP protocol. We’ve added commands to choose a mailbox and to download an email. More commands for other IMAP features will arrive with future Feature Releases.

4D for iOS

Push

Push Notifications are available with 4D for iOS. They provide users with relevant information to encourage them to engage with an app. Simply define a push notification message and title, and 4D for iOS will handle the sending process for you.

In addition, when push notifications are activated for an installed app on your iPhone, you also get the notifications on your Apple Watch!

 

Email Authentication

4D for iOS enables you to easily determine the authenticity and legitimacy of the person trying to log in to your app by verifying that an email comes from whom it claims to be sent from. Basically, the process updates a user’s session status to give them access to the application:

  • When a user enters their email address in the login form and clicks on the Login button, their session status is updated to “pending” status.
  • A validation email is then sent to the user, who will just need to click on the validation link to update their session status from “pending” to “accepted”.
  • Once the validation process is completed, the user can reopen the app and because their session status is “accepted”, access is now granted.

The component that handles and makes the process easier is also available so you can adapt the authentication to suit your own needs.

 

Build detail form templates

You can now drop as many fields as you want onto your detail form template because they’re scrollable. There are many ways to add your fields to your detail forms:

  • Select a blank template in which you can drop all your field without any constraint, or,
  • Drag and drop fields anywhere in the view to add and display them immediately after the last added field or between other already displayed fields, or,
  • Double-click on a field. Your field will be added at the end of the list, or,
  • Right-click on one of the available fields in the Fields table on the left. This will display a menu that lets you add any missing fields to your Detail forms.

 

Security

New Cryptokey Class

A new class providing a set of methods for performing common cryptographic operations (such as signature and verification, encryption, and decryption) is now available: CryptoKey class. It provides a way to protect the confidentiality of your data, as well as to verify the integrity of messages, and the authenticity of the sender. It could be used for:

  • Confidentiality: protect data from unauthorized access
  • Integrity: ensure data is complete and correct
  • Authenticity: validate the authenticity of a message sender/recipient

Quick Report

Support of virtual structures

Using the virtual structure in Quick Reports is now possible. This allows you to set alternative table and field names (aliases) in order to make them more readable for end users. 

 

4D write Pro

Direct export to PDF

Without installing any print drivers or additional software, 4D Write Pro documents can be exported directly to PDF format. The direct export is not only faster and more reliable than going through a print driver, it also gives you more control over the result. In addition to supporting hyperlinks, it allows you to optimize image size and more. The WP EXPORT DOCUMENT command has been updated to accept a new constant: wk pdf.

Formulas: Manage carriage return behavior

A new document property defining how a carriage return should be treated is available: wk break paragraphs in formulas. It has two possible values:

  • wk true: Interpreted as paragraph breaks.
  • wk false: (default value) Interpreted as line breaks.

import and export from the 4D Write Pro widget

A new tab is available in the 4D Write Pro interface widget allowing you to import and export documents in different formats. 

4D View Pro

Offscreen Area

A new command to manipulate 4D View Pro commands and functions in an offscreen area is available: VP Run offscreen area. To use it, simply pass the area’s information in parameter (e.g., the area name and the method called when an event is thrown by the 4D View Pro area).

Merge and unmerge cells

A new set of commands is at your disposal to help you merge and unmerge a group of cells by programming:

  • To create a merged cell: define a range with all of the cells you want to combine, then pass it in parameter to the new VP  ADD SPAN command which combines the cells into a single a span of cells.
  • Use the VP Get spans command to retrieve all of the merged cells.
  • Remove the spanned cells in your document with the VP REMOVE SPAN command.

   
formulas: Recalculate, suspend, and resume

Three new commands are available allowing you to trigger the calculations of the formulas whenever you wish:

  • VP RECOMPUTE FORMULAS – to recalculate formulas when data changes.
  • VP SUSPEND COMPUTING and VP RESUME COMPUTING – allow you to, respectively, suspend and resume calculations.
 
 

Want to know more? Read all blog posts about 4D v18 R4