AFVersion Class
- Last UpdatedNov 18, 2025
- 7 minute read
- PI System
- AF SDK 2024 R2
- Developer

Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| Children | Obsolete.
The list of all objects owned by the specific version of the owner object without
regard to the query date.
| |
| Comment |
This read/write property returns the comment associated with this version
of the owning object.
| |
| CreationDate |
This read-only property returns the time when the version of the owning object was
created.
| |
| Creator |
This read-only property returns the user who created the version
of the owning object.
| |
| EffectiveDate |
This read-only property returns the time when the version of the owning object
goes into effect.
| |
| HasMultipleVersions |
This read-only property returns if multiple versions of this object exist.
| |
| Modifier |
This read-only property returns the user who last modified the version
of the owning object.
| |
| ModifyDate |
This read-only property returns the time when the object was last modified.
| |
| ObsoleteDate |
This read-only property returns the time when the owning object becomes obsolete.
| |
| Owner |
This read-only property returns the object which owns this
version information.
| |
| RevisionNumber |
This read-only property returns the revision number associated with this version
of the owning object.
| |
| VersionID |
This read-only property returns the unique identifier for the version.
|
Methods
| Name | Description | |
|---|---|---|
| CompareTo |
Compares this instance with a specified Object.
| |
| Create |
Creates a new version of an object at the specified effective date.
| |
| Delete |
Removes the object version from the owner object.
| |
| Equals |
Determines whether the specified Object is equal to the current object.
(Overrides ObjectEquals(Object).) | |
| FindVersion |
Gets a version of the owning object by query date and retrieval type.
| |
| FindVersions |
Gets all the versions of the owning object.
| |
| GetChildren |
Gets the list of all objects owned by the specific version of the owner object
without regard to the query date.
| |
| 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.) | |
| GetParents |
Gets the list of all parent objects of the owner object without regard to the query date.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| LatestVersion |
Gets the latest version of the owning object.
| |
| NextVersion |
Gets the next version of the owning object.
| |
| PreviousVersion |
Gets the previous version of the owning object.
| |
| SetEffectiveDate |
Set the effective date for this version of the owning object.
| |
| SetObsoleteDate |
Set the obsolete date for this version of the owning object.
| |
| ToString |
Returns a String that represents the current object.
(Overrides ObjectToString.) |
Operators
| Name | Description | |
|---|---|---|
| Equality |
The equality operator (==) compares its operands to determine if they are equal.
| |
| GreaterThan |
The greater than relation operator (>) compares its operands to determine
which one is greater than the other.
| |
| GreaterThanOrEqual |
The greater than or equal relation operator (>=) compares its operands to determine
which one is greater than or equal to the other.
| |
| Inequality |
The inequality operator (!=) compares its operands to determine if they are not equal.
| |
| LessThan |
The less than relation operator (<) compares its operands to determine
which one is less than the other.
| |
| 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.
| 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. |