Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

best Practice to delete DOM instance

Solved198 views27th March 2026
2
Juan Falcon90 26th March 2026 0 Comments

Hello

Im using this code to delete all the records, its posible made the delete without a form? or made the delete by definition

var read = domHelper.DomInstances.ReadAll();
foreach (var item in read)
{
domHelper.DomInstances.Delete(item);
}

Regards

Juan

Juan Falcon Selected answer as best 27th March 2026

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
1
Jarno Lernou [SLC] [DevOps Enabler]5.88K Posted 27th March 2026 1 Comment

Hi Juan,

There's a solid documentation page that addresses Processing multiple DomInstances - examples | DataMiner Docs. Feel free to take a look. There's a specific section as well related to deletion.

// Retrieve the DomInstances that need to get deleted.
var domInstances = domHelper.DomInstances.Read(filter);

// Remove them from the DB.
var deleteResult = domHelper.DomInstances.Delete(domInstances);

Kind Regards,
Jarno

Juan Falcon Selected answer as best 27th March 2026
Juan Falcon commented 27th March 2026

Thanks, i was looking but dint find it.

1
Kévin Dugué [DevOps Enabler]853 Posted 27th March 2026 1 Comment

Hi Juan,

Here is an example of deleting DOM instances filtered by definition and state. Note that there is a limit of 100, so you can use a batching method to delete them in chunks.

 private void DeleteInstancesInBatches(DomHelper domHelper, List<DomInstance> instances, int batchSize)
 {
     for (int i = 0; i < instances.Count; i += batchSize)
     {
         int countToRemove = Math.Min(instances.Count - i, batchSize);

         domHelper.DomInstances.Delete(
             instances
                 .GetRange(i, countToRemove)
                 .ToList());
     }
 }

 private void RemoveCancelledTasks()
 {
     DomHelper domHelper = new DomHelper(_engine.SendSLNetMessages, SlcTasksIds.ModuleId);

     var definitionFilter = DomInstanceExposers.DomDefinitionId.Equal(SlcTasksIds.Definitions.Task.Id);
     var stateFilter = DomInstanceExposers.StatusId.Equal(SlcTasksIds.Behaviors.TaskFlow.Statuses.Cancelled);

     var taskInstances = domHelper.DomInstances
         .Read(definitionFilter.AND(stateFilter))
         .ToList();

     DeleteInstancesInBatches(domHelper, taskInstances, 100);
 }
Jarno Lernou [SLC] [DevOps Enabler] Posted new comment 31st March 2026
Jarno Lernou [SLC] [DevOps Enabler] commented 31st March 2026

You're right about this small but important disclaimer. To be complete, this is also described on the page I had mentioned: https://docs.dataminer.services/dataminer/Functions/DOM/DomHelper_class.html#maximum-number-of-instances

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin