ServerObject.Parent
The ServerObject.Parent property allows a script to access the properties of the parent database item
Syntax |
ServerObject.Parent |
Description |
Identifies the parent item (Group) of the database item that is referenced by the ServerObject. |
Arguments |
None. |
Returns |
Value {variant}. When reading a property value, the Parent property returns a value. The value is a variant (string, integer, Boolean and so on depending on the type of value being read). |
Example:
The following script displays a message box that contains the FullName value of the Group that contains the Mimic in which the script is stored:
Set objHomeMimic = Server.ThisObject
MsgBox "Parent Group = " &objHomeMimic.Parent.FullName
Where:
- objHomeMimic is the name of the variable that stores the ServerObject that is returned by the ThisObject function.
- Server.ThisObject instructs the script to search for the Mimic that contains the script. It returns a ServerObject that references the Mimic.
- MsgBox "Parent Group = " &objHomeMimic.Parent.FullName instructs the script to display a message box that contains the message 'Parent Group = x' where x is the FullName value of the Group that is referenced by the ServerObject stored in the objHomeMimic variable. The FullName property of the parent Group is accessed via the ServerObject's Parent property.
So, when the script is executed, it displays a message box that shows the FullName value of the Group that contains the Mimic (that stores the script).