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

Home

 
4D v19.8
entitySelection.getDataClass( )

entitySelection.getDataClass( ) 


 

entitySelection.getDataClass () -> Result 
Parameter Type   Description
Result  DataClass in Dataclass object to which the entity selection belongs

The entitySelection.getDataClass( ) method returns the dataclass of the entity selection. This method is mainly useful in the context of generic code.

Example  

The following generic code duplicates all entities of the entity selection:

  //duplicate_entities method
  //duplicate_entities($1)
  //duplicate_entities(entity_selection)
 
 C_OBJECT($dataClass;$1;$entitySelection;$entity;$duplicate;$status)
 $entitySelection:=$1
 $dataClass:=$entitySelection.getDataClass()
 For each($entity;$entitySelection)
    $duplicate:=$dataClass.new()
    $duplicate.fromObject($entity.toObject())
    $duplicate[$dataClass.getInfo().primaryKey]:=Null //reset the primary key
    $status:=$duplicate.save()
 End for each



See also 

4D Blog - ORDA member methods to get the structure information
dataClass.getDataStore( )
dataClass.getInfo( )
entity.getDataClass( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R5

 
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)