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

AF SDK Reference

AFContact Class

  • Last UpdatedNov 18, 2025
  • 10 minute read
AFContact Class
A AFContact provides contact information maintained by AF.

Inheritance Hierarchy

SystemObject
  OSIsoft.AFAFObject
    OSIsoft.AFAFContact

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

Syntax

[SerializableAttribute]
public sealed class AFContact : AFObject, 
	IAFTransactable, IAFChangedEvent, IAFSecurable, IComparable<AFContact>
<SerializableAttribute>
Public NotInheritable Class AFContact
	Inherits AFObject
	Implements IAFTransactable, IAFChangedEvent, IAFSecurable, IComparable(Of AFContact)

Dim instance As AFContact
[SerializableAttribute]
public ref class AFContact sealed : public AFObject, 
	IAFTransactable, IAFChangedEvent, IAFSecurable, IComparable<AFContact^>
[<SealedAttribute>]
[<SerializableAttribute>]
type AFContact =  
    class
        inherit AFObject
        interface IAFTransactable
        interface IAFChangedEvent
        interface IAFSecurable
        interface IComparable<AFContact>
    end

The AFContact type exposes the following members.

Constructors

  NameDescription
Public method
AFContact(PISystem)
Initializes a new instance of the class with default values.
Public method
AFContact(PISystem, String)
Initializes a new instance of the class with the specified name.

Properties

  NameDescription
Public property
BusinessPhone
The contact's primary business phone number.
Public property
CanonicalName
This property is the canonical name of the contact.
Public property
CheckOutInfo
This read-only property returns the checked out status information for the object.
Public property
ContactType
This property specifies the type of contact.
Public property
Department
The name of the department in which the contact works.
Public property
Description
Read/write property that provides a more detailed description of the object.
Public property
EMail
The contact's primary email address.
Public property
FaxNumber
The contact's primary facsimile phone number.
Public property
HomePhone
The contact's primary home phone number.
Public property
ID
Read-only property that provides a unique identifier for the object to be used for quick access that is not dependent upon the index.
(Inherited from AFObject.)
Public property
Identity
This read-only property contains identity of the object.
(Inherited from AFObject.)
Public property
IMAddress
The contact's primary instant messaging address.
Public property
IPPhone
The contact's primary IP phone number.
Public property
IsDefinedByActiveDirectory
Indicates whether the contact is defined by ActiveDirectory.
Public property
IsDeleted
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.)
Public property
IsDirty
This read-only property indicates whether the object has been modified since the last save to the PI AF Server.
Public property
IsNew
This read-only property indicates whether the object is new and has never been saved to the PI AF Server.
Public property
Manager
The name of the contact's manager.
Public property
MobilePhone
The contact's primary mobile phone number.
Public property
Name
Read/write property that identifies the name of the object.
Public property
PagerNumber
The contact's primary pager phone number.
Public property
PISystem
This read-only property allows access to the PISystem associated with this object.
(Inherited from AFObject.)
Public property
PostalAddress
The contact's postal address.
Public property
PreferredLanguage
The contact's preferred language.
Public property
Security
This read-only property returns the AFSecurity information for the object.
Public property
UniqueID
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.)

Methods

  NameDescription
Public methodCode example
ApplyChanges
This method applies the changes to the object and makes those changes available to other objects for the current user.
Public methodCode example
CheckIn
This method checks in (commits) all the changes to the object by saving the information to persistent storage.
Public method
CheckOut
This method locks the object so that its configuration can be modified.
Public methodStatic member
CheckOutContacts
Check out the objects with the specified unique identifiers at the specified query date.
Public method
CompareTo(Object)
Compares this instance with a specified Object.
(Inherited from AFObject.)
Public method
CompareTo(AFObject)
Compares this instance with a specified AFObject.
(Inherited from AFObject.)
Public method
Delete
Deletes this contact from the PISystem.
Public methodStatic member
DeleteContacts
Delete the objects with the specified unique identifiers.
Public method
Equals(Object)
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.)
Public method
Equals(AFObject)
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.)
Public methodStatic member
FindContact(PISystem, Guid)
Retrieves the AFContact object with the specified unique identifier.
Public methodStatic member
FindContact(PISystem, String)
Retrieves the AFContact object with the specified name.
Public methodStatic member
FindContacts(PISystem, String, AFSearchField, AFSortField, AFSortOrder, Int32)
Performs a text search within the PISystem to retrieve a collection of AFContact objects that match the specified query string.
Public methodStatic member
FindContacts(PISystem, String, AFSearchField, AFSortField, AFSortOrder, Int32, Boolean)
Performs a text search within the PISystem to retrieve a collection of AFContact objects that match the specified query string and to optionally not include contacts defined by Active Directory.
Public methodStatic member
FindRelatedContacts
Retrieves the contacts that are related to the specified AFContact.
Public methodStatic member
GetCurrentUser
Retrieves the AFContact object for the current user.
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.
(Inherited from AFObject.)
Public method
GetPath
Returns the full path to the object, using just the names.
(Inherited from AFObject.)
Public method
GetPath(AFObject)
Returns the path to the object relative from another object.
(Inherited from AFObject.)
Public method
GetPath(AFEncodeType, AFObject)
Returns the path to the object relative from another object, using the name and/or id as specified by encodeType.
(Inherited from AFObject.)
Public method
GetSecurity
Gets the AFSecurity information of the specified security item associated with the object.
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic member
LoadContacts
Loads the AFContact objects with the specified unique identifiers.
Public method
Persist
This method returns the persistence string for the object.
(Inherited from AFObject.)
Public method
Refresh
Refreshes the client with any changes that have been made to the object since loaded.
Public method
ToString
Returns a String that represents the current object.
(Inherited from AFObject.)
Public method
UndoCheckOut
This method discards all the changes to the object and all sub-objects since the last call to CheckOut. Any changes since the check out will be lost.

Events

  NameDescription
Public eventCode example
Changed
Event is raised when the object or one of its sub-objects is changed.

Remarks

The list of contact information is maintained by AF. Most of the contact information is obtained from Microsoft Active Directory. Additional User contacts can be added using the AFContact constructor. A contact not defined by Active Directory can be deleted using the AFContact.Delete method. If a contact is defined by Active Directory, it cannot be modified through this SDK.

Examples

// This example demonstrates how to use several properties of the AFContact object.
PISystems myPISystems = new PISystems();
PISystem myPISystem = myPISystems.DefaultPISystem;

// Display the number of AFContacts found
AFNamedCollectionList<AFContact> contacts =
    AFContact.FindContacts(myPISystem, "A*", AFSearchField.Name, AFSortField.Name,
        AFSortOrder.Ascending, 10);
Console.WriteLine("AFContact count = {0}", contacts.Count);

// Display information for the first AFContact
if (contacts.Count > 0)
{
    AFContact myContact = contacts[0];
    Console.WriteLine("Name of Contact = {0}", myContact.Name);
    Console.WriteLine("Description of Contact = {0}", myContact.Description);
    Console.WriteLine("EMail of Contact = {0}", myContact.EMail);
    Console.WriteLine("HomePhone of Contact = {0}", myContact.HomePhone);
}

// Add a new AFContact
AFContact newContact = new AFContact(myPISystem, "NewContact*");
myPISystem.CheckIn();
' This example demonstrates how to use several properties of the AFContact object.
Dim myPISystems As New PISystems
Dim myPISystem As PISystem = myPISystems.DefaultPISystem

' Display the number of AFContacts found
Dim contacts As AFNamedCollection(Of AFContact)
contacts = AFContact.FindContacts(myPISystem, "A*", AFSearchField.Name,
    AFSortField.Name, AFSortOrder.Ascending, 10)
Console.WriteLine("AFContact count = {0}", contacts.Count)

' Display information for the first AFContact

If (contacts.Count > 0) Then
    Dim myContact As AFContact = contacts(0)
    Console.WriteLine("Name of Contact = {0}", myContact.Name)
    Console.WriteLine("Description of Contact = {0}", myContact.Description)
    Console.WriteLine("EMail of Contact = {0}", myContact.EMail)
    Console.WriteLine("HomePhone of Contact = {0}", myContact.HomePhone)
End If

' Add a new AFContact
Dim newContact As AFContact = New AFContact(myPISystem, "NewContact*")
myPISystem.CheckIn()

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

Version Information

AFSDK


See Also

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