Product

OB New: an easy way to initialize an object

Discover OB New, the new command of 4D to initialize an object. This command allows you to either create an empty object or create it with some initial properties and values. OB SET is now becoming unnecessary in several situations, OB New is enough.

OB New also allows to re-initialize an temporary object in a loop or simply directly pass an object as a parameter to a 4D command requesting an object as parameter, as Get database measures or GRAPH commands for instance.

This new command changes your way to write 4D code in many situations. OB New creates an object and returns a reference to it. It allows more flexibility in your code. This command is the first of a series of new features related to  objects … Stay tuned !

Product 4D Database: Search in array attribute

Search by linking array attribute query arguments

Object fields, introduced with 4D v15, allows to store and index unstructured data. This could be a common set of data, like first name, last name, birthday. It could be different data in each record, such as a shop that will need different attributes for shoes (size, color), computers (CPU, memory), printers (color, ink), a list of values or all in any combination.

Here is a real User Story from a 4D customer :

My badge application manages the access rights for each person to a building and for a time slot. This information is stored in a database as an array of objects ( e.g.: {access right, building, time slot} ). I want to be able to look for people who have access to a building during a time slot.”

4D provides several ways to query for data, using index and so extremely fast.

Product 4D Database: Sort records by object attribute

Sort records by object attribute

At each 4D release, object fields become more and more powerful.

A new 4D command for sorting your record selections according to one or more attributes is now available with 4D v16 R2. The new command ORDER BY ATTRIBUTE works the same as the command ORDER BY; you just have to pass an attribute path by which you want to order your selection – easy!

Product

Go further with Object fields

Object fields introduced with v15 allows unstructured data bases, similar to schemaless database (NoSQL). 4D v16 goes a big step further. Get a dynamic structure for unstructured data… Confused?

Imagine you use an object field to allow your customers to store custom data, where they can create their own fields. This works well and is one of the most interesting reasons for using an object field. The problem is, how to allow your customer to query this unstructured data? You don’t know which ‘fields’ they used, you cannot build a query editor on top or offer a drop down with used values.