KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to Clear an Entity Selection
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: February 14, 2022

To clear an entity selection stored in a variable, the .newSelection() function can be used.
The function will load a new empty entity selection for the specified dataclass which can be assigned to the variable to clear the currently loaded entity selection.

For example, the following line will create an entity selection of all records into $myEntSel:

$myEntSel:= ds.Table_1.all()

The entity selection can be cleared by calling the following:
$myEntSel:= ds.Table_1.newSelection()