Fields Object

<< Click to Display Table of Contents >>

 

Fields Object

The Fields Fields object represents a collection of Fields of a Historic on a table. This object is created automatically when adding a Historic to an application, and contains a Field called E3TimeStamp, which represents the timestamp when the record's value was retrieved.

To insert new Fields, right-click the Fields object and select the Insert - Historic Field option or select the Fields object and click Add Add - Historic Field on Historic's toolbar. To remove a Field, right-click the Field and select the Delete option or select a Field and click Remove Remove on Historic's toolbar.

 

NOTE

The E3TimeStamp Field is a read-only Field and cannot be removed from the Fields object.

Users can drag and drop Historic Fields from one Historic to another. However, the PrimaryKey property of a Historic Field is not persisted when copying this Field inside the same Historic, because this property is an information belonging to the Historic and not to the Field.

In applications created before version 5.0 of E3, the Fields property of a Historic is a standard collection, which supports the Item method to access the available Fields. Starting with version 5.0, this property also returns a Fields object, native to E3, and therefore the way to access Fields is different for both ways. The next example shows the correct way to use it as a native object and as a collection in a script.

Applications saved in version 5.0 convert Historic objects from the collection format to a native object and CANNOT be opened in previous versions anymore.

 

To access the collection of Historic Fields available as a collection as well as a native object, use the formats described in the next example.

'This application contains an object called Hist1
'that contains a Field called Field1.
'To access this Field as a collection,
'use the following syntax:
Set collectionField = Application.GetObject("Hist1").Fields.Item("Field1")
'To access the same Field as a native object,
'use the following syntax:
Set nativeField = Application.GetObject("Hist1.Fields.Field1")

 

Please check topic Historic Field for more information about the properties of the existing Historic Fields in the Fields object.

Was this page useful?