docs: public Record getReferenceRecord(RecordOwner screen, boolean bCreateIfNotFound)
      {
          if ((m_recordReference == null)
              && (bCreateIfNotFound))
          {
              RecordOwner recordOwner = screen;
              if (recordOwner == null)
                  if (this.getRecord() != null)
                      recordOwner = Record.findRecordOwner(this.getRecord());
              this.setReferenceRecord(this.makeReferenceRecord(recordOwner));
              if (m_recordReference != null)  // getReferenceRecord() would cause an endless loop
              {
                  m_recordReference.setOpenMode(m_recordReference.getOpenMode() | DBConstants.OPEN_READ_ONLY);    // By default a reference record can't be changed
                  if (screen == null)
                      if (recordOwner != null)   // The caller wanted to have a record without a recordowner.
                      {
                          recordOwner.removeRecord(m_recordReference);    // Set it is not on the recordowner's list
                          if (this.getRecord() != null)
                          {   // Make sure record is freed when this record is freed.
                              FreeOnFreeHandler listener = (FreeOnFreeHandler)this.getRecord().getListener(FreeOnFreeHandler.class);
                              while (listener != null)
                              {
                                  if (listener.getDependentObject() == m_recordReference)
                                      break;  // listener is already there
                                  listener = (FreeOnFreeHandler)listener.getListener(FreeOnFreeHandler.class);
                              }
                              if (listener == null)
                                  this.getRecord().addListener(new FreeOnFreeHandler(m_recordReference));
                          }
                      }
              }
          }
          else if ((m_recordReference != null)
              && (m_recordReference.getRecordOwner() == null)
                  && (screen != null))
          {
              screen.addRecord(m_recordReference, false);
              m_recordReference.setRecordOwner(screen);   // Now you have a record owner.
          }
          return m_recordReference;
      }