4D v19

entity.getKey( )

Home

 
4D v19
entity.getKey( )

entity.getKey( )  


 

The entity.getKey( ) method returns the primary key value of the entity.

Primary keys can be numbers (longint) or strings. You can "force" the returned primary key value to be a string, no matter the actual primary key type, by passing the dk key as string option in the mode parameter.

Example  

 C_OBJECT($employees;$employee)
 $employees:=ds.Employee.query("lastName=:1";"Smith")
 $employee:=$employees[0]
 ALERT("The primary key is "+$employee.getKey(dk key as string))



See also 

dataClass.get( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - Entity

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

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