diff --git a/entity/PlanningChangeStatusAndResponsible_entity/recordcontainers/jdito/onInsert.js b/entity/PlanningChangeStatusAndResponsible_entity/recordcontainers/jdito/onInsert.js
index 4f967df1dc20bbacd8717e82ad1252736a616c6c..14addd0dc1415ae52b7c7d3a9fb6a9576cc0aa1b 100644
--- a/entity/PlanningChangeStatusAndResponsible_entity/recordcontainers/jdito/onInsert.js
+++ b/entity/PlanningChangeStatusAndResponsible_entity/recordcontainers/jdito/onInsert.js
@@ -47,9 +47,10 @@ else if(responsible)
     vals = [responsible];
 }
 
-
-db.updateData(table, cols, null, vals, newWhere("FORECAST.FORECASTID", planningIds, SqlBuilder.IN()).toString());
-
+if(planningIds.length > 0)
+{
+    db.updateData(table, cols, null, vals, newWhere("FORECAST.FORECASTID", planningIds, SqlBuilder.IN()).toString());
+}
 
 var notUpdatedRecordsLength = (planningObj.length - planningIds.length);
 var descriptionText = "%0 out of %1 records were changed to \"%2\".\n %3 record/s could not be updated.";