AFEventFrame.DeleteEventFrames Method
- Last UpdatedJan 12, 2026
- 3 minute read
- PI System
- AF SDK 3.2.0
- Developer
Delete the objects with the specified unique identifiers.
Namespace: OSIsoft.AF.EventFrame
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.2.0.7
Syntax
public static void DeleteEventFrames( PISystem system, IList<Guid> ids )
Public Shared Sub DeleteEventFrames ( system As PISystem, ids As IList(Of Guid) ) Dim system As PISystem Dim ids As IList(Of Guid) AFEventFrame.DeleteEventFrames(system, ids)
public: static void DeleteEventFrames( PISystem^ system, IList<Guid>^ ids )
static member DeleteEventFrames : system : PISystem * ids : IList<Guid> -> unit
Parameters
- system
- Type: OSIsoft.AFPISystem
The PISystem containing the objects to be deleted. - ids
- Type: System.Collections.GenericIListGuid
A list of the unique identifiers of the objects to be checked out.
Remarks
This method will delete the objects in the specified list of ids with out requiring a checkout of the object. If the object is already checked out by another user the specified object will still be deleted.
This method will delete all references, including sandbox, to any object specified in the list of ids where the user has Delete permission on the object.
Examples
// This example demonstrates how to use efficiently delete event frames using // AFEventFrameSearch and the DeleteEventFrames method. // Get the Database PISystems myPISystems = new PISystems(); PISystem myPISystem = myPISystems.DefaultPISystem; AFDatabase myDB = myPISystem.Databases.DefaultDatabase; // Search for the event frames to be deleted. using (var search = new AFEventFrameSearch(myDB, "FindEventFrames", @"Template:'MyTemplate'")) { search.CacheTimeout = TimeSpan.FromMinutes(10); // Get a list of IDs of event frames to be deleted in pages of 100. foreach (IList<Guid> pageOfIds in search.FindObjectIds().ChunkedBy(100)) { AFEventFrame.DeleteEventFrames(myPISystem, pageOfIds); } }