docs: public ReferenceField getReferenceField(Record record)
      {
          String strRecordName = null;
          if (record != null)
              strRecordName = record.getTableNames(false);
          ReferenceField fldBestGuess = null;
          for (int i = 0; i < this.getKeyAreaCount(); i++)
          {
              KeyArea keyArea = this.getKeyArea(i);
              BaseField fieldFirst = keyArea.getKeyField(DBConstants.MAIN_KEY_FIELD).getField(DBConstants.FILE_KEY_AREA);
              if (fieldFirst instanceof ReferenceField)
              {
                  if (fldBestGuess == null)
                      fldBestGuess = (ReferenceField)fieldFirst;
                  else if (((ReferenceField)fieldFirst).getReferenceRecordName().toString().equals(strRecordName))
                      fldBestGuess = (ReferenceField)fieldFirst;
              }
          }
          return fldBestGuess;
      }