What’s new in 4D v17 R6

4D for ios – Preview

Actions with parameters

Editing data directly from your app is now possible thanks to actions. This means that you can edit data directly in your iOS app using an edit form that can be defined in the Project Editor. For each action, you can edit the following properties: Name, long label, short label, format Input constraints, placeholder, mandatory field definition, and default value. Also, this R-release includes predefined actions to manage your app content: Add, Edit, and Delete. 

The On Mobile App Action database method is available to call your 4D methods. A Case of code block will be generated including all your actions names.



Advanced programming capabilities

Retrieve the current execution call chain

4D v17 R6 provides the new Get call chain command to give you insight into the executed code. This helps you know where you are in your code, especially when one method calls other methods, which may then call other methods. The command returns a collection of objects with each object representing an execution step and describing its database, method type, method name, and call line. The command can be used in all code execution contexts, in both interpreted and compiled modes.


analyze debug logs

A new tool is available to help you to analyze the debug logs. For example, you’ll be able to see which processes are the most time-consuming, the call chain with its corresponding run time, and much more. This tool is designed to help you find conflicts in your code and improve the performance of your databases.



Manage callback methods and subtotal spacing in Quick Reports

4D v17 R6 adds two new features to Quick Reports:

  • Catch events in standalone reports: now you can set the “methodName” parameter in the QR REPORT command. This method is a callback that runs on each managed event: qr cmd open, qr cmd save, qr cmd save as, qr cmd generate, qr cmd page setup, qr cmd print preview. In the callback method, you can intercept all the managed events, do what you have to do, and execute the event with the QR EXECUTE COMMAND command. 
  • Manage subtotal spacing: It’s now possible to specify either a page break or a different line-height for each subtotal. In the case of a different line-height, the difference can be expressed in points (pt) or percentages (%).


Dynamic forms and the Entry Order

With 4D v17 R6, you can define an input order that is not necessarily associated with the z-order. For each page of your form definition, the “objects” attribute contains a list of form elements which are arranged following the z-order. A new attribute has been added to this list: “entryOrder”. It allows you to specify your own customized input order. If this attribute is undefined, 4D uses the z-order (i.e., the order defined in the “objects” attribute).


CSS color strings 

Instead of declaring CSS colors using a 4-byte Long Integer (e.g., 0x00RRGGBB), the OBJECT SET RGB COLORS command as well as the LISTBOX SET ROW COLOR and LISTBOX SET GRID COLOR commands now support CSS colors as strings such as “blue”, “#0000FF”, and RGB(0,0,255).



Write queries using formulas

With 4D v17 R6, the query() method has been updated to support a Formula object as a parameter and return a new object of EntitySelection type containing all of the entities found. This allows the creation of more sophisticated search criteria. 


Order an entity selection

4D v17 R6 introduces a new ORDA method: orderByFormula(). With the help of formulas, you can now order an entity selection using complex criteria in a project method or in a 4D expression. The formula evaluates the order criteria which can be given in the form of a String or a Formula object to the method orderByFormula().



Log ORDA requests

New ORDA methods are available on the ds object to help you debug and optimize your ORDA code so you can gain a better understanding of sent requests. The startRequestLog() method is very flexible since, when called with a File object, it can log ORDA requests to a file or to memory. To stop logging ORDA requests, you can call the stopRequestLog() method.


4D view Pro

Use collections to read and write

Four new commands are available to allow you to read a large number of different values or formulas easier, faster, and at the same time via collections: VP SET VALUES, VP Get values, VP SET FORMULAS, and VP Get formulas. To set values or formulas in cells, simply create a collection where each element represents a row. Each row is a collection of cell values to be set in the columns. For reading, you can pass a range of cells to VP Get values. The command returns the values in the corresponding collections.


Style customization 

With 4D v17 R6, you can programmatically customize the style of your 4D View Pro documents. Three different options are available. You can use the:

  • default style commands to define the general style of a sheet with the VP SET DEFAULT STYLE and VP Get default style commands, or
  • style sheet commands to define frequently used custom styles with the VP ADD STYLESHEET, VP REMOVE STYLESHEET, VP Get stylesheet, and VP Get stylesheets commands, or
  • cell style commands to define the style of specific cells with the VP SET CELL STYLE and VP Get cell style commands.

Also, the new VP SET BORDER  command has been added so you can manage the borders of a range.


Get control over your method settings

4D v17 R6 provides a new command allowing you to specify a 4D method’s parameters, name, type, and include a summary: VP SET ALLOWED METHODS. Now your methods can be more informative and descriptive to end-users.



Source control – Beta

We started beta testing Projects (allowing source control) with 4D v17 R5. Beta testing continues with 4D v17 R6 with more supported functions and features, such as Toolbox (menus, help tips, filters, etc.), backup settings, and MSC support for .4dproject or .4dz.