4D Blog

Home Product ORDA: Breaking news for entity selection methods

ORDA: Breaking news for entity selection methods

May 5, 2020

Product

When it comes to ORDA, 4D v18 R3 is full of good news! New member methods are at your disposal to further enhance your coding experience.

For starters, extracting data from an entity selection has been greatly enriched allowing you to build a fully customized collection with your entity selection data.

In addition, we’re providing you a way to indicate to an entity selection that its data needs to be refreshed from the server immediately, invalidating cached data.

Interested in some details? Keep reading, everything you need to know is below. 

extract data from an entity selection

The new extract() member method is available on an entity selection. 

You can now build a customized collection from an entity selection!

Example 1

In the extract() member method, you can specify the dataclass attributes you want to extract and their names in the resulting collection.

Given this simple database:

We build a $mailing collection of objects with specific property names: “recipient, “city”, “zipCode”.

C_COLLECTION($mailing)
$mailing:=ds.Interns.all().extract("lastname";"recipient";\
"employer.city";"city";\
"employer.zipCode";"zipCode")

and here is the resulting

$mailing collection:

[
{recipient:Hodge,city:Blakeslee,zipCode:18610},
{recipient:Metzler,city:Medfield,zipCode:02052},
{recipient:Broyles,city:Madison,zipCode:13402}
]

Example 2

Note that dataclass attributes which are a related entity can be extracted as a collection of entities.

A possible use case is to handle a collection of entities from different dataclasses.

In the example below, we build the Form.partners collection which contains entities from the Company and School dataclasses.

blank

 

C_COLLECTION($companies;$schools)
 
// $companies is a collection of entities of Company dataclass
$companies:=ds.Interns.all().extract("employer")
 
// $schools is a collection of entities of School dataclass
$schools:=ds.Interns.all().extract("school")
 
Form.partners:=$companies.concat($schools) // Form.partners is a collection

 

Then, the Form.partners collection is ready to be displayed in a list box!blank

Check the documentation for the refresh() and extract() member methods to learn more!

Refresh an entity selection

The new refresh() member method is available on an entity selection. It invalidates the entity selection data in the ORDA cache so that the next time you use the data, it triggers an update from the server.

By default, the ORDA cache expires after 30 seconds, so use the refresh() member method just in case you need up to date data immediately.

Example

You have some attributes of the Form.invoices entity selection displayed in a list box and at a given time, you want to display updates done by other clients on those entity selection attributes. Easy! Just use the refresh() member method.

Form.invoices.refresh() // The Form.invoices entity selection displayed data will be refreshed from the server

 

Discuss

Tags Entity selection, ORDA, Programming, Refresh, v18 R3, v19

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Avatar
Marie-Sophie Landrieu-Yvert
- Product Owner - Marie-Sophie Landrieu-Yvert joined the 4D Product team as a Product Owner in 2017. In this role, she is responsible for writing user stories and translating them into functional specifications. She also ensures that the delivered feature implementation meets the customer's needs. Marie-Sophie graduated from the engineering school ESIGELEC and began her career as an engineer at IBM in 1995. She took part in various projects (maintenance and development projects) and worked as a COBOL developer. She then moved on to work as a UML designer and Java developer. More recently, her main responsibilities included analyzing and writing functional requirements, and coordinating business and development teams.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy