EntityVisible
Description
Returns the visibility type of a record. This method returns an indication of whether the entity exists or not and is able to distinguish between an entity that exists and an entity that exists but is hidden.
With the EntityVisible method, an integration can decide not to load a referenced record in the cases where it is not visible and would otherwise result in an error of it attempted to do so. (The EntityExists method indicates a record exists even when it is hidden and cannot be loaded.)
The method provides support for references and reference lists if you use record hiding. With record hiding, a user may be able to see a record, but not see a record that is referenced by one of its fields.
This method can also be used to set up security context records, for a reference between related defects in order to block users from creating a reference to a defect a user cannot view. The method provides information about whether a record is visible or not.
For stateful records, the display name argument (display_name) is the id string (for example, RAMBU00001234).
For stateless records, display_name is composed of concatenation of all the unique key field values with a space character between. For example, if a project record type has two fields, name and department, and they are both designated as unique key fields, the display_name would be "<name> <department>"
For a project with name "ACME" and department "Finance":
exists_flag = session.EntityVisible "Project", "ACME Finance"
For a project with the name "ACME" that has one unique key field, name:
exists_flag = session.EntityVisible "Project", "ACME"
Syntax
VBScript
session.EntityVisible
entity_def_name, display_name
Perl
$session->EntityVisible
(entity_def_name, display_name);
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- entity_def_name
- A String containing the record type (EntityDef) name.
- display_name
- A String containing the display name (id string) of the record
- Return value
- Returns a Long containing an EntityStatus enum value.
Examples
VBScript
set sessionObj = GetSession
ResultFromEntityVisible = sessionObj.EntityVisible("defect", "test00000001")
Perl
$sessionObj = $entityObj->GetSession();
$ResultFromEntityVisible = $sessionObj->EntityVisible("defect", "test00000001");