Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFVersion Class

  • Last UpdatedNov 18, 2025
  • 7 minute read
AFVersion Class
The AFVersion object returns information about a specific version of an ASDK object.

Inheritance Hierarchy

SystemObject
  OSIsoft.AF.AssetAFVersion

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public sealed class AFVersion : IComparable, 
	IComparable<AFVersion>
Public NotInheritable Class AFVersion
	Implements IComparable, IComparable(Of AFVersion)

Dim instance As AFVersion
public ref class AFVersion sealed : IComparable, 
	IComparable<AFVersion^>
[<SealedAttribute>]
type AFVersion =  
    class
        interface IComparable
        interface IComparable<AFVersion>
    end

The AFVersion type exposes the following members.

Properties

  NameDescription
Public property
Children Obsolete.
The list of all objects owned by the specific version of the owner object without regard to the query date.
Public property
Comment
This read/write property returns the comment associated with this version of the owning object.
Public property
CreationDate
This read-only property returns the time when the version of the owning object was created.
Public property
Creator
This read-only property returns the user who created the version of the owning object.
Public property
EffectiveDate
This read-only property returns the time when the version of the owning object goes into effect.
Public property
HasMultipleVersions
This read-only property returns if multiple versions of this object exist.
Public property
Modifier
This read-only property returns the user who last modified the version of the owning object.
Public property
ModifyDate
This read-only property returns the time when the object was last modified.
Public property
ObsoleteDate
This read-only property returns the time when the owning object becomes obsolete.
Public property
Owner
This read-only property returns the object which owns this version information.
Public property
RevisionNumber
This read-only property returns the revision number associated with this version of the owning object.
Public property
VersionID
This read-only property returns the unique identifier for the version.

Methods

  NameDescription
Public method
CompareTo
Compares this instance with a specified Object.
Public method
Create
Creates a new version of an object at the specified effective date.
Public method
Delete
Removes the object version from the owner object.
Public method
Equals
Determines whether the specified Object is equal to the current object.
(Overrides ObjectEquals(Object).)
Public method
FindVersion
Gets a version of the owning object by query date and retrieval type.
Public method
FindVersions
Gets all the versions of the owning object.
Public method
GetChildren
Gets the list of all objects owned by the specific version of the owner object without regard to the query date.
Public method
GetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ObjectGetHashCode.)
Public method
GetParents
Gets the list of all parent objects of the owner object without regard to the query date.
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
LatestVersion
Gets the latest version of the owning object.
Public method
NextVersion
Gets the next version of the owning object.
Public method
PreviousVersion
Gets the previous version of the owning object.
Public method
SetEffectiveDate
Set the effective date for this version of the owning object.
Public method
SetObsoleteDate
Set the obsolete date for this version of the owning object.
Public method
ToString
Returns a String that represents the current object.
(Overrides ObjectToString.)

Operators

  NameDescription
Public operatorStatic member
Equality
The equality operator (==) compares its operands to determine if they are equal.
Public operatorStatic member
GreaterThan
The greater than relation operator (>) compares its operands to determine which one is greater than the other.
Public operatorStatic member
GreaterThanOrEqual
The greater than or equal relation operator (>=) compares its operands to determine which one is greater than or equal to the other.
Public operatorStatic member
Inequality
The inequality operator (!=) compares its operands to determine if they are not equal.
Public operatorStatic member
LessThan
The less than relation operator (<) compares its operands to determine which one is less than the other.
Public operatorStatic member
LessThanOrEqual
The less than or equal relation operator (<=) compares its operands to determine which one is less than or equal to the other.

Remarks

The AFVersion object can be thought of as a time series array of instances of the owner object. The array is arranged in chronological order with the first member being the oldest. Each member has an EffectiveDate. This is the date and time the Owner object went into effect. That version of the object remains in effect up to the time of the next member. If the object is the newest member, then it is effective up to the current time. If the object is no longer valid, an ObsoleteDate can be specified.

When changing between versions, the owning object's QueryDate is set to the last time in that version's time range. If the LatestVersion is obtained, then the owning object's QueryDate is initialized to AFTime.MaxValue so that the latest versions of sub-objects are retrieved.

The objects that support versions are AFElement, AFModel, and AFTable. The description for these classes will describe which of their properties and collections are common across all versions and which are specific to each version.

Use the PISystem.Supports method to check if the PISystem supports the Versioning feature.

Caution note Caution
Using object versions can be expensive in memory usage and performance. Extra memory is required to store the versions in the server and for each version of the object loaded in the client. Performance is degraded because of the extra data to be searched in the server and returned back to the client.

Examples

For an example of how to use object versions, see Version Example.

Version Information

AFSDK


See Also

TitleResults for “How to create a CRG?”Also Available in