You are here: Core Reference > Coding > Scripting > ServerObject.Id

ServerObject.Id

The ServerObject.Id property returns the Id value for the database item that is referenced in the script by the ServerObject. The Id is a unique number that identifies the item in the database and is used to link an item to its history and events and so on.

Syntax

ServerObject.Id

Description

Accesses the Id value of a database item that is referenced by a ServerObject in the script.

Arguments

None.

Returns

Id {integer}

The Id value of database item that is referenced in the script by the ServerObject. The Id is unique to the database item and is an identifier that is used for accessing the item's historic data and events.

Example:

The following script is used to display the Id of a point named 'Tank Level' in a message box:

Set objTankLevel = Server.FindObject("Tanks.Tank Level")

MsgBox "Tank Level Id = " &objTankLevel.Id

Where:

  • objTankLevel is the name of the variable that stores the ServerObject that is returned by the FindObject function.
  • Server.FindObject("Tanks.Tank Level") instructs the script to search for the 'Tank Level' item that is stored in the 'Tanks' Group.
  • MsgBox "Tank Level Id = " &objTankLevel.Id instructs the script to display a message box that contains the message 'Tank Level Id = x' where x is the Id value of the item referenced by the ServerObject that is stored in the objTankLevel variable.

ClearSCADA 2015 R2