docs: public Record getReference()
      {
          Record record = this.getReferenceRecord();
          if (record != null)
          {
              try   {
                  if (this.getData() == null)
                  {
                      record.addNew();
                      return record;
                  }
                  Object bookmark = this.getData();
                  if ((record.getEditMode() == Constants.EDIT_IN_PROGRESS)
                      || (record.getEditMode() == Constants.EDIT_CURRENT))
                  {
                      Object oldBookmark = record.getHandle(DBConstants.BOOKMARK_HANDLE);
                      if ((bookmark != null) && (bookmark.equals(oldBookmark)))
                          return record;  // This record is already current
                  }
                  record.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
              } catch (DBException ex)    {
                  ex.printStackTrace();
                  record = null;
              }   
          } 
          return record;
      }