4D Blog

Home Product ORDA – Say Goodbye to Empty Spaces in Your Entity Selections

ORDA – Say Goodbye to Empty Spaces in Your Entity Selections

July 18, 2024

Product

We’ve all been there. You build a beautiful interface that displays an entity selection for users. They can drop entities to refine their choices, but then… those empty spaces appear where the dropped entities used to be.

Rebuilding the entity selection after drops? No more! 4D 20 R6 introduces a handy feature that eliminates this pain point with just one line of code.

Keep reading to discover how this feature can keep your interface clean and your users happy.

HDI_CleanEntitySelection

the clean function on the entity selection object

Let’s dive into how this feature works.

An entity selection is displayed, and the user can delete some entities.

The list box below displays the Form.persons entity selection. The user selects some of them (Form.selected) and click on a Drop button. If we run only this code:

Form.selected.drop()

Form.persons:=Form.persons

We get this:

With just one line of code, thanks to the new clean() function:

Form.persons:=Form.persons.clean()

The empty spaces are magically gone, leaving your interface clean and user-friendly:

blank

The clean parameter in the $entityset REST API

If your application relies on REST APIs, you can also use the clean parameter with the $entityset REST API.

If you have an entity set containing deleted entities (as featured by the blue object containing the __STAMP property) like this one:

{
"__DATACLASS": "Persons",
"__entityModel": "Persons",
"__GlobalStamp": 0,
"__COUNT": 3,
"__FIRST": 0,
"__ENTITIES": [
{

"__STAMP": 0


}
,
{
"__KEY": "2",
"__TIMESTAMP": "2024-05-23T09:26:19.658Z",
"__STAMP": 1,
"ID": 2,
"firstname": "Broddy",
"lastname": "Cristofanini"
},
{
"__KEY": "3",
"__TIMESTAMP": "2024-05-23T09:26:19.658Z",
"__STAMP": 1,
"ID": 3,
"firstname": "Candie",
"lastname": "Figin"
}
],
"__SENT": 3
}

You can get a new entity set without the deleted entities by running the request below (949062617AF6408CB198B3CB41FB72FB is the entity set ID):

/$entityset/949062617AF6408CB198B3CB41FB72FB?$clean=true&$method=entityset

The result? An entity set without the deleted entries:

{
"__ENTITYSET": "/rest/Persons/$entityset/8F658F3BA1884DE6BEC1FCFF4A7938F0",
"__DATACLASS": "Persons",
"__entityModel": "Persons",
"__GlobalStamp": 0,
"__COUNT": 2,
"__FIRST": 0,
"__ENTITIES": [
{
"__KEY": "2",
"__TIMESTAMP": "2024-05-23T09:47:50.933Z",
"__STAMP": 1,
"ID": 2,
"firstname": "Broddy",
"lastname": "Cristofanini"
},
{
"__KEY": "3",
"__TIMESTAMP": "2024-05-23T09:47:50.933Z",
"__STAMP": 1,
"ID": 3,
"firstname": "Candie",
"lastname": "Figin"
}
],
"__SENT": 2
}

With this new feature, managing entity selections has never been easier. Keep your interfaces tidy and your users happy!

Discuss

Tags 20 R6, 21, Deletion of records, Entity selection, ORDA

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

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

  • AI
  • 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 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 Compatibility settings Formula Google Listbox Logs Mail 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 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 Compatibility settings Formula Google Listbox Logs Mail 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