GetDbId
Description
Returns the Entity object's database ID number.
The return value is a database ID. This value is used internally by the database to keep track of records. Do not confuse this value with the defect ID number returned by GetDisplayName. DBIDs are unique to a class of records, and unique within the stateful records, and unique within the stateless records.
Note: For more information on DBIDs, see Working with records
Syntax
VBScript
entity.GetDbId
Perl
$entity->GetDbId
();
- Identifier
- Description
- entity
- An Entity object representing a user data record. Inside a hook, if you omit this part of the syntax, the Entity object corresponding to the current data record is assumed (VBScript only).
- Return value
- A Long containing the Entity object's database ID.
Examples
VBScript
set session = GetSession
set record1 = session.GetEntity("defect", "test00000001")
dbid = record1.Getdbid
set record1 = session.GetEntityByDbId("defect", dbid)
Perl
#Assume you have $entityObj, an Entity Object
$sessionObj = $entityObj->GetSession();
$dbid = $entityObj->GetDbId();
#...
#Later, to get the record again:
$entityObj = $sessionObj->GetEntityByDbId("defect",$dbid);