docs: public Record getReferenceRecord()
      {
          Record recordReference = this.getReferenceRecord(null);
          if (recordReference != null)
          	if (recordReference.getRecordOwner() == null)	// Only add it if it doesn't belong to any other screen.
          {
              RecordOwner recordOwner = null;
              if (this.getRecord() != null)
                  recordOwner = Record.findRecordOwner(this.getRecord());
              if (recordOwner != null)
                  recordOwner.addRecord(recordReference, false);
              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() == recordReference)
                          break;  // listener is already there
                      listener = (FreeOnFreeHandler)listener.getListener(FreeOnFreeHandler.class);
                  }
                  if (listener == null)
                      this.getRecord().addListener(new FreeOnFreeHandler(recordReference));
              }
          }
          return recordReference;
      }