Considerations When Deleting Child Records
When you delete a child record, either through the UI or a Web service call, a foreign key reference to the child is maintained in the parent record. This foreign key reference is maintained so that if the deleted child record is restored, the association that the record had with parent records can also be restored.
Web service calls querying the record with the foreign key reference can give unexpected results. To avoid this situation, it is recommended that before you delete a child record, you first remove the association between the child record and the parent record. Web service calls will then not return the foreign key reference.
If you want to remove a retained foreign key reference from a parent record, associate a temporary child record, then remove the association and delete the temporary child record.