How to Completely Delete All Records from a Custom DocType Without Touching the Backend?

Hi Everyone,

We have a custom DocType that was used only for development and testing. Before moving to production (or redeveloping the module), we want to completely remove all records from this DocType so that it starts with zero records.

Problem

We are unable to delete the records from the ERPNext UI because:

  • Many records are in different workflow states.

  • Some records are linked to other documents, resulting in Link Validation errors during deletion.

  • As a result, bulk deletion through the UI is not possible.

Additional Information

  • This is a custom DocType developed by our team.

  • All existing records are test/development data only.

  • We do not need to preserve any of these records or their relationships.

  • We would like to achieve this without directly modifying the database or touching the backend.

Questions

  1. Is there a supported way in Frappe/ERPNext to completely delete all records from a custom DocType while bypassing workflow and link validations?

  2. Is there any built-in tool, utility, patch, or recommended approach to clean the DocType without performing direct database operations?

  3. If not, what would be the recommended approach in this scenario?

Environment

  • ERPNext Version: 15

Any guidance would be greatly appreciated.