DeleteEntity
Description
Deletes the specified record from the current database.
When you call this method, HCL Compass deletes the specified entity using the action whose name you specified in the deleteActionName parameter. This action name must correspond to a valid action in the schema and it must be legal to perform the action on the specified entity.
Syntax
VBScript
session.DeleteEntity
entity, deleteActionName
Perl
$session->DeleteEntity
(entity, deleteActionName);
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- entity
- The Entity object corresponding to the record to be deleted.
- deleteActionName
- A String containing the name of the action to use when deleting the entity.
- Return value
- Returns an empty string ("") on success. Returns a String containing the error message if there was a problem deleting the Entity. Use error checking code for handling error messages and exceptions. See Error checking and validation
Examples
VBScript
set sessionObj = GetSession
' Delete the record whose ID is "BUGDB00000042" using the "delete"
' action
set objToDelete = sessionObj.GetEntity("defect", "BUGDB00000042")
sessionObj.DeleteEntity objToDelete, "delete"
Perl
$sessionobj = $entity->GetSession();
# Delete the record whose ID is "BUGDB00000010" using the "delete"
# action
$objtodelete = $sessionobj->GetEntity("defect", "BUGDB00000010");
$sessionobj->DeleteEntity($objtodelete,"delete");