code: public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
      { // Read a valid record
          if (((iChangeType == DBConstants.DELETE_TYPE) && m_bNoDelete)
              || ((iChangeType == DBConstants.FIELD_CHANGED_TYPE) && m_bNoModify))
              if (((this.getOwner().getEditMode() & DBConstants.EDIT_ADD) != DBConstants.EDIT_ADD)
                  && (!this.getOwner().isRefreshedRecord()))
          {
              String strError = "Can't delete records";
              if (iChangeType == DBConstants.FIELD_CHANGED_TYPE)
                  strError = "Can't modify records";
              org.jbundle.model.Task task = null;
              if (this.getOwner().getRecordOwner() != null)
                  task = this.getOwner().getRecordOwner().getTask();
              if (task != null)
                  strError = ((BaseApplication)task.getApplication()).getResources(ResourceConstants.ERROR_RESOURCE, true).getString(strError);
              if (task != null)
                  return this.getOwner().getRecordOwner().getTask().setLastError(strError);
              return DBConstants.ERROR_RETURN;
          }
          return super.doRecordChange(field, iChangeType, bDisplayOption);   // Initialize the record
      }
docs: Called when a change is the record status is about to happen/has happened.
  On an add or lock, makes sure the main key field is set to the current main target field
  so it will be a child of the current main record.
  @param field If this file change is due to a field, this is the field.
  @param iChangeType The type of change that occurred.
  @param bDisplayOption If true, display any changes.
  @return an error code.
  Before an add, set the key back to the original value.