GetEntity

Description

Returns the specified record.

When requesting a state-based record type, the display_name parameter must contain the visible ID of the record (for example, "DEF00013323"). For stateless record types, this parameter must contain the value of the record's unique key field.

To request a record using its database ID instead of its visible ID, use GetEntityByDbId.

Note: To optimize performance, if you want to retrieve some but not all field values for a record, it is more efficient to use queries than calling GetEntity. You can build a query on the State field to avoid getting the whole record.

Syntax

VBScript


session.GetEntity(entity_def_name, display_name) 

Perl


$session->GetEntity(entity_def_name, display_name); 
Identifier
Description
session
The Session object that represents the current database-access session.
entity_def_name
A String that identifies the name of the record type to which the record belongs.
display_name
A String that identifies the display name of the record. The display name should be either the visible ID for request entities or the unique key fields for aux entities.
Return value
Returns an Entity Object corresponding to the requested record.

Examples

VBScript


set sessionObj = GetSession 
sessionObj.UserLogon "admin", "", "SAMPL", AD_PRIVATE_SESSION, ""
set record1 = sessionObj.GetEntity("defect", "DEF00013323") 

Perl

$sessionObj = $entity->GetSession();
$sessionObj->UserLogon("admin","","SAMPL","");

#Get record DEF00013323
$record1 = $sessionObj->GetEntity( "defect", "DEF00013323" );