Ajay/Melanie | #3901 | Bugfix - Check for datarecord before deleting it