diff --git a/entity/DuplicateScan_entity/DuplicateScan_entity.aod b/entity/DuplicateScan_entity/DuplicateScan_entity.aod
index 74e964fd18e7c2fe99950c2ba386daceb52b5a28..5794d0e0864cd56c4a5b2427727bd8c954bfbf56 100644
--- a/entity/DuplicateScan_entity/DuplicateScan_entity.aod
+++ b/entity/DuplicateScan_entity/DuplicateScan_entity.aod
@@ -74,6 +74,7 @@
     <dbRecordContainer>
       <name>DBRecordContainer</name>
       <alias>Data_alias</alias>
+      <onDBDelete>%aditoprj%/entity/DuplicateScan_entity/recordcontainers/dbrecordcontainer/onDBDelete.js</onDBDelete>
       <linkInformation>
         <linkInformation>
           <name>b61b26d3-e823-45ba-9ac5-12acaaa1ec15</name>
diff --git a/entity/DuplicateScan_entity/recordcontainers/dbrecordcontainer/onDBDelete.js b/entity/DuplicateScan_entity/recordcontainers/dbrecordcontainer/onDBDelete.js
new file mode 100644
index 0000000000000000000000000000000000000000..67f82ff481621c8858908c0ea44243b1dc24a661
--- /dev/null
+++ b/entity/DuplicateScan_entity/recordcontainers/dbrecordcontainer/onDBDelete.js
@@ -0,0 +1,19 @@
+import("system.db");
+import("system.vars");
+import("Sql_lib");
+
+var currentId = vars.getString("$field.UID");
+
+if (currentId)
+{
+    var toDelete = [
+        "DUPLICATESCANCONDITIONCONFIG",
+    ];
+    
+    toDelete = toDelete.map(function(pTable)
+    {
+        return [pTable, SqlCondition.equals(pTable + ".DUPLICATESCAN_ID", currentId, "1=2")]
+    });
+    
+    db.deletes(toDelete);
+}
\ No newline at end of file