4D v19

dataClass.getDataStore( )

Home

 
4D v19
dataClass.getDataStore( )

dataClass.getDataStore( )  


 

The dataClass.getDataStore( ) method returns the datastore for the specified dataclass.

The datastore can be:

  • the main datastore, as returned by the ds command. 
  • a remote datastore, opened using the Open datastore command.

Example  

The SearchDuplicate project method searches for duplicated values in any dataclass.

 C_OBJECT($pet)
 $pet:=ds.Cats.all().first() //get an entity
 SearchDuplicate($pet;"Dogs")

  // SearchDuplicate method
  // SearchDuplicate($1;$2)
  // SearchDuplicate(entity_to_search;dataclass_name)
 
 C_OBJECT($1;$pet;$dataStore;$duplicates)
 C_TEXT($2;$dataClassName)
 $pet:=$1
 $dataClassName:=$2
 $dataStore:=$pet.getDataClass().getDataStore()
 $duplicates:=$dataStore[$dataClassName].query("name=:1";$pet.name)



See also 

entitySelection.getDataClass( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - DataClass

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

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