4D v19

dataClass.getInfo( )

Home

 
4D v19
dataClass.getInfo( )

dataClass.getInfo( )  


 

The dataClass.getInfo( ) method returns an object providing information about the dataclass. This method is useful for setting up generic code.

Returned object

 

PropertyTypeDescription
namestringName of the dataclass
primaryKeystringName of the primary key of the dataclass
tableNumbernumberInternal 4D table number (not returned if the dataclass is from a remote datastore)

 C_OBJECT($1;$e;$status)
 $e:=$1 //$1 is an entity
 
 computeEmployeeNumber($e//do some actions on entity
 
 $status:=$e.save()
 if($status.success)
    ALERT("Record updated in table "+$e.getDataClass().getInfo().name)
 End if

 C_OBJECT($es;$settings)
 
 $settings:=New object
 $settings.parameters:=New object("receivedIds";getIds())
 $settings.attributes:=New object("pk";ds.Clients.getInfo().primaryKey)
 $es:=ds.Clients.query(":pk in :receivedIds";$settings)

 C_TEXT($pk)
 C_OBJECT($dataClassAttribute)
 
 $pk:=ds.Employee.getInfo().primaryKey
 $dataClassAttribute:=ds.Employee[$pk// If needed the attribute matching the primary key is accessible



See also 

4D Blog - ORDA member methods to get the structure information
dataStore.getInfo( )
entitySelection.getDataClass( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - DataClass

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)