AFContact Class
- Last UpdatedNov 18, 2025
- 10 minute read
- PI System
- AF SDK 2024 R2
- Developer
A AFContact provides contact information maintained by AF.

Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| AFContact(PISystem) |
Initializes a new instance of the class with default values.
| |
| AFContact(PISystem, String) |
Initializes a new instance of the class with the specified name.
|
Properties
| Name | Description | |
|---|---|---|
| BusinessPhone |
The contact's primary business phone number.
| |
| CanonicalName |
This property is the canonical name of the contact.
| |
| CheckOutInfo |
This read-only property returns the checked out status information for the object.
| |
| ContactType |
This property specifies the type of contact.
| |
| Department |
The name of the department in which the contact works.
| |
| Description |
Read/write property that provides a more detailed description of the object.
| |
The contact's primary email address.
| ||
| FaxNumber |
The contact's primary facsimile phone number.
| |
| HomePhone |
The contact's primary home phone number.
| |
| 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.) | |
| Identity |
This read-only property contains identity of the object.
(Inherited from AFObject.) | |
| IMAddress |
The contact's primary instant messaging address.
| |
| IPPhone |
The contact's primary IP phone number.
| |
| IsDefinedByActiveDirectory |
Indicates whether the contact is defined by ActiveDirectory.
| |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| IsDirty |
This read-only property indicates whether the object has been modified since the
last save to the PI AF Server.
| |
| IsNew |
This read-only property indicates whether the object is new and has never been saved
to the PI AF Server.
| |
| Manager |
The name of the contact's manager.
| |
| MobilePhone |
The contact's primary mobile phone number.
| |
| Name |
Read/write property that identifies the name of the object.
| |
| PagerNumber |
The contact's primary pager phone number.
| |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| PostalAddress |
The contact's postal address.
| |
| PreferredLanguage |
The contact's preferred language.
| |
| Security |
This read-only property returns the AFSecurity information for the object.
| |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) |
Methods
| Name | Description | |
|---|---|---|
| ApplyChanges |
This method applies the changes to the object and makes
those changes available to other objects for the current user.
| |
| CheckIn |
This method checks in (commits) all the changes to the object by saving
the information to persistent storage.
| |
| CheckOut |
This method locks the object so that its configuration can be modified.
| |
| CheckOutContacts |
Check out the objects with the specified unique identifiers at the specified query date.
| |
| CompareTo(Object) |
Compares this instance with a specified Object.
(Inherited from AFObject.) | |
| CompareTo(AFObject) |
Compares this instance with a specified AFObject.
(Inherited from AFObject.) | |
| Delete |
Deletes this contact from the PISystem.
| |
| DeleteContacts |
Delete the objects with the specified unique identifiers.
| |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.) | |
| Equals(AFObject) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.) | |
| FindContact(PISystem, Guid) |
Retrieves the AFContact object with the specified unique identifier.
| |
| FindContact(PISystem, String) |
Retrieves the AFContact object with the specified name.
| |
| 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.
| |
| 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.
| |
| FindRelatedContacts |
Retrieves the contacts that are related to the specified AFContact.
| |
| GetCurrentUser |
Retrieves the AFContact object for the current user.
| |
| 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.) | |
| GetPath |
Returns the full path to the object, using just the names.
(Inherited from AFObject.) | |
| GetPath(AFObject) |
Returns the path to the object relative from another object.
(Inherited from AFObject.) | |
| 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.) | |
| GetSecurity |
Gets the AFSecurity information of the specified security item
associated with the object.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| LoadContacts |
Loads the AFContact objects with the specified unique identifiers.
| |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| Refresh |
Refreshes the client with any changes that have been made to the object since loaded.
| |
| ToString |
Returns a String that represents the current object.
(Inherited from AFObject.) | |
| 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
| Name | Description | |
|---|---|---|
| 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.