This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
entitySelection.query( )

entitySelection.query( ) 


 

entitySelection.query ( queryString | formula {; value}{; value2 ; ... ; valueN}{; querySettings}) -> Result 
Parameter Type   Description
queryString | formula  Text, Object in Search criteria as string or formula object
value  Mixed in Value(s) to compare when using placeholder(s)
querySettings  Object in Query options: parameters, attributes, args, allowFormulas, context, queryPath, queryPlan
Result  EntitySelection in New entitySelection made up of entities from entity selection meeting the search criteria specified in queryString

The entitySelection.query( ) method searches for entities that meet the search criteria specified in queryString or formula and (optionally) value among all the entities in the entity selection, and returns a new object of type EntitySelection containing all the entities that are found. Lazy loading is applied.

Note: This method does not modify the original entity selection.

If no matching entities are found, an empty EntitySelection is returned.

For detailed information on how to build a query using queryString, value, and querySettings parameters, please refer to the dataClass.query( ) method description.

Note: By default if you omit the order by statement in the queryString, the returned entity selection is not ordered (for more information, please refer to Ordered vs Unordered entity selections). Note however that, in Client/Server mode, it behaves like an ordered entity selection (entities are added at the end of the selection). 

 C_OBJECT($entitySelectionTemp)
 $entitySelectionTemp:=dataClass.query("lastName = :1";"M@")
 Form.emps:=$entitySelectionTemp.query("manager.lastName = :1";"S@")

More examples of queries can be found in the dataClass.query( ) page. 



See also 

collection.query( )
dataClass.query( )
entitySelection.orderBy( )
entitySelection.queryPath
entitySelection.queryPlan

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17
Modified: 4D v17 R5
Modified: 4D v17 R6

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)