4D Blog

Home Tips Tips: ORDA Data Model Classes

Tips: ORDA Data Model Classes

August 18, 2020

Tips

By now you’re aware of the availability of ORDA classes. In this blog post, you’ll learn a few handy tips to get the most out of them!

UsE strongly typed variables

You can strongly type your ORDA variables and take advantage of autocompletion thanks to the var keyword.

In the example below, $dataclass is typed as a dataclass class (cs.Students) and initialized with the Students dataclass object (ds.Students). Autocompletion automatically suggests:

  • all of the functions defined at the dataclass level (new(), query(), etc.)
  • all of the functions that you’ve implemented yourself in cs.Students (in this example: search())

 

Call functions dynamically

You’ve most likely used the [ ] notation to access the attributes of an object (e.g., $myObject[“propertyName”]). This is also possible with functions!

Here’s an example (psst …. don’t forget the ( ) at the end!):

There is a getDescription() function defined on the datastore class.

Class extends DataStoreImplementation
Function getDescription
 C_TEXT($0)
 $0:="Learning system covering "+String(This.Students.all().length)+" students"

It can be dynamically called like this:
C_TEXT($what;$functionName;$1)
$functionName:=$1
// $functionName can be "getDescription"
$what:=ds[$functionName]()

Discuss

Tags API, Class, Data model, ORDA, Remote database, Remote datastore, REST server, v18 R4, v19

Latest related posts

  • September 15, 2025

    Find the right spot in your 4D Write Pro document with AI

  • September 2, 2025

    Intelligent 4D Write Pro document analysis with AI

  • August 25, 2025

    ORDA – Constructor and touched event – Detailed behaviour through a network

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
  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming 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