docs: public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
      {
          if (!m_bReadOnly)
          {
              Object bookmark = null;
              BaseBuffer buffer = null; // In case a temp buffer is needed
              boolean bSuccess = false;
              Object oldBuff = this.getOwner().getData();     // Get a copy of the old key field
              Record record = this.getOwner().getRecord();
              if (record.getEditMode() != Constants.EDIT_ADD)
              {   // Current record (but no changes) - save the bookmark only for possible re-read.
                  try   {
                      bookmark = record.getHandle(DBConstants.DATA_SOURCE_HANDLE);
                  } catch (DBException e)   {
                      bookmark = null;
                  }
              }
              int result = super.doSetData(data, bDisplayOption, iMoveMode);  // Do the rest of the behaviors
              if (result != DBConstants.NORMAL_RETURN)
                  return result;  // If error
              if ((!this.getOwner().isJustModified()) || (data == null))
                  return result;  // If no change or set to null
              String iOldKeySeq = record.getKeyArea(-1).getKeyName();
              record.setKeyArea(keyName);
              if ((!record.isModified(true)) && ((record.getEditMode() == Constants.EDIT_ADD) || (record.getEditMode() == Constants.EDIT_NONE)))   // Modified or valid record
              {   // This is a new record and this is the first mod
                  try   {
                      buffer = new VectorBuffer(null);
                      record.getKeyArea(keyName).setupKeyBuffer(buffer, DBConstants.FILE_KEY_AREA);   // Save the keys
                      bSuccess = this.seek(record); // Read this record (display if found)
                      record.setKeyArea(iOldKeySeq);      // Set the key order back
                      if (!bSuccess)
                      {   // Not found, restore the data and the new key
                          record.addNew();            // This may wipe out the keys
                          if (buffer != null)
                              buffer.resetPosition();   // Just to be careful
                          record.getKeyArea(keyName).reverseKeyBuffer(buffer, DBConstants.FILE_KEY_AREA); // Restore the keys
                          result = DBConstants.NORMAL_RETURN;     // Everything went okay
                      }
                      else
                      {   // Record found - good
                          if (record.getRecordOwner().isBatch())
                          {   // Special case - Can't display this record
                              return DBConstants.DUPLICATE_KEY;
                          }
                      }
                  } catch (DBException e)   {
                      return e.getErrorCode();    // Never
                  }
              }
              else if (record.getKeyArea(keyName).getUniqueKeyCode() == DBConstants.UNIQUE)
              { // Data already entered, see if this entry makes a duplicate key!
                  buffer = new VectorBuffer(null);
                  try   {
                      buffer.fieldsToBuffer(record, BaseBuffer.ALL_FIELDS); // Save the entire record
                      bSuccess = this.seek(record); // See if this key already exists
                      if (bookmark != null)
                      {
                          if (record.setHandle(bookmark, DBConstants.DATA_SOURCE_HANDLE) != null)   // Set the pointer back to the old key
                              record.edit();
                          else
                              record.addNew();    // Never
                      }
                      else
                          record.addNew();// This is a new record, and they entered non-key data already
                      record.setKeyArea(iOldKeySeq);      // Set the key order back
                      buffer.bufferToFields(record, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE);   // Restore the data
                      for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < record.getFieldCount() + DBConstants.MAIN_FIELD; iFieldSeq++)
                      {   // Redisplay all the fields
                          record.getField(iFieldSeq).displayField();
                      }
                  } catch (DBException e)   {
                      return e.getErrorCode();    // Never
                  }
                  if (bSuccess)
                  {
                      this.getOwner().setData(oldBuff, bDisplayOption, iMoveMode);        // Restore a copy of the old key field
                      result = DBConstants.DUPLICATE_KEY;     // Can't enter this key, you'll get a dup key!
                  }
                  else
                      result = DBConstants.NORMAL_RETURN;     // Good, this is a valid key
              }
              return result;
          }
          else
          {       // Read only
              Record record = this.getOwner().getRecord();
              int result = super.doSetData(data, bDisplayOption, iMoveMode);  // Do the rest of the behaviors
              if (result != DBConstants.NORMAL_RETURN)
                  return result;  // If error or no change
              if (!this.getOwner().isJustModified())
                  return result;  // If error or no change
              String strOldKeySeq = Constants.BLANK;
              strOldKeySeq = record.getKeyArea(-1).getKeyName();
              record.setKeyArea(keyName);
              if (!record.isModified(true))   // Modified or valid (Need valid for secondary lookups)
              {
                  try   {
                      if ((data == null)
                          || (data.equals(Constants.BLANK)))
                      {
                          record.addNew();  // Clear the fields!
                      }
                      else
                      {   // This is a new record and this is the first mod
                          boolean bSuccess = this.seek(record);    // Read this record (display if found)
                          if (!bSuccess)
                              record.initRecord(bDisplayOption);  // Clear the fields!
                      }
                  } catch (DBException e)   {
                      return e.getErrorCode();    // Never
                  } finally {
                      record.setKeyArea(strOldKeySeq);      // Set the key order back
                  }
              }
              return result;
          }
      }