Make the record represented by this DataRecord current.
@param dataRecord tour.db.DataRecord
349183
public boolean setDataRecord(DataRecord dataRecord)
    {
        this.setCurrentRecord(this.getBaseRecord());
        Object[] rgobjEnabledFields = this.getBaseRecord().setEnableFieldListeners(false);
        boolean bSuccess = super.setDataRecord(dataRecord);
        this.getBaseRecord().setEnableFieldListeners(rgobjEnabledFields);
        if (bSuccess)
        {
            Record record = this.getBaseRecord();
            record.handleValidRecord(); // Display Fields
            record = this.moveToCurrentRecord(record);
            if (record != null) if (record != this.getBaseRecord())
                record.handleValidRecord(); // Display Fields
        }
        return bSuccess;
    }
717768
public void fixRecord(Record record)
    {
        super.fixRecord(record);
        if (this.getProperty("field") != null)
        {
            BaseField field = this.getMainRecord().getField(this.getProperty("field").toString());
            if (field != null)
                this.fixCapitalization(field);
        }
    }
166831
public void set(Rec fieldList) throws DBException
    {
        this.syncCurrentToBase();
        boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
        this.getRecord().handleRecordChange(DBConstants.UPDATE_TYPE);   // Fake the call for the grid table
        this.getRecord().setEnableListeners(rgbListenerState);
        
        super.set(fieldList);        
        this.syncCurrentToBase();

        rgbListenerState = this.getRecord().setEnableListeners(false);
        this.getRecord().handleRecordChange(DBConstants.AFTER_UPDATE_TYPE);   // Fake the call for the grid table
        this.getRecord().setEnableListeners(rgbListenerState);
    }
477222
public Record openMainRecord()
    {
        Record record = null;
        if (this.getProperty(DBParams.APPLET) != null)
        	return null;	// Ignore params if I want the applet html displayed
        String strParamRecord = this.getProperty(DBParams.RECORD);      // Display record
        if ((strParamRecord != null) && (strParamRecord.length() > 0))
            record = Record.makeRecordFromClassName(strParamRecord, this);
        return record;
    }
1099424
protected void cleanupCurrentRecord() throws IOException {
        if (this.currentRecord != null) {
            this.currentRecord.close();
            gotoEOR(this.currentRecord);
            this.currentRecord = null;
        }
    }
207511
public void initSharedRecord(Record record)
    {
        FieldListener listener = null;
        try {
            BaseField field = record.getSharedRecordTypeKey();
            field.addListener(listener = new InitOnceFieldHandler(null));
            field.setData(new Integer(0), true, DBConstants.INIT_MOVE);
            field.setData(new Integer(0), true, DBConstants.INIT_MOVE);
            if (field != null)
                if (field.getDataClass() == Integer.class)
            {
                for (int i = 1; ; i++)
                {
                    Integer intData = new Integer(i);
                    field.setData(intData);
                    record.addNew();
                    Record recShared = record.getTable().getCurrentTable().getRecord();
                    if (recShared == null)
                        break;
                    if (recShared == record)
                        break;
                    if (recShared.getField(field.getFieldName()).getValue() != i)
                        break;
                    this.disableAllListeners(recShared);
                }
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        } finally {
            if (listener != null)
                record.removeListener(listener, true);
        }
    }
145425
public void updateIfNewRow(int iRowIndex)
        throws DBException
    {
        if ((m_iCurrentLockedRowIndex != -1) && (m_iCurrentLockedRowIndex != iRowIndex))
            if (m_buffCurrentLockedData != null)
        {
            {
                FieldList fieldList = this.makeRowCurrent(m_iCurrentLockedRowIndex, false);     // Read this row if it isn't current
                if (this.isRecordChanged())
                {   // Only update if there are changes.
                    synchronized (this)
                    {   // This time do the physical read (last time I asked for the cache)
                        DBException ex = null;
                        fieldList = this.makeRowCurrent(m_iCurrentLockedRowIndex, true);        // Read this row if it isn't current
                        if ((this.isAppending())
                            && ((m_iCurrentLockedRowIndex == m_iLastRecord + 1) && (m_iLastRecord != RECORD_UNKNOWN)))
                        {
                            m_table.add(fieldList);   // New record = add
                            this.setCurrentRow(-1);     // Make sure I don't try to use this unknown record without re-reading it.
                            if (m_iLastRecord != RECORD_UNKNOWN)    // Could have been set in 'add'
                                m_iLastRecord++;
                        }
                        else
                        {
                            if ((fieldList.getEditMode() == Constants.EDIT_CURRENT) || (fieldList.getEditMode() == Constants.EDIT_IN_PROGRESS))
                            {
                                try {
                                    m_table.set(fieldList);   // Current record = set
                                } catch (DBException e) {
                                    ex = e;
                                }
                            }
                            this.setCurrentRow(-1);    // Can't use current record anymore
                        }
                        m_iCurrentLockedRowIndex = -1;
                        m_buffCurrentLockedData = null;
                        if (ex != null)
                            throw ex;
                    }
                }
            }
        }
    }
1019779
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);

        m_gridList = new DataRecordList();      
        m_iEndOfFileIndex = UNKNOWN_POSITION; // Actual end of file (-1 means don't know)

        m_gridBuffer = new DataRecordBuffer();
        m_gridNew = new DataRecordBuffer();
        m_iPhysicalFilePosition = UNKNOWN_POSITION;
        m_iLogicalFilePosition = UNKNOWN_POSITION;

        if (((record.getOpenMode() & DBConstants.OPEN_READ_ONLY) != DBConstants.OPEN_READ_ONLY)
            && (record.getCounterField() != null))
                record.setOpenMode(record.getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY);  // Must have for GridTable to re-read.
    }
942941
public Record setRecordCurrent()
    {
        Record recordMain = this.getMainRecord();
        try   {
            if (recordMain != null)
            {
                if (m_objectID != null)
                { // Read the request
                    if (recordMain.setHandle(m_objectID, DBConstants.BOOKMARK_HANDLE) != null)
                        recordMain.edit();
                    else
                        m_objectID = null;
                }
                if (m_objectID == null)
                    if ((recordMain.getEditMode() != DBConstants.EDIT_CURRENT) && (recordMain.getEditMode() != DBConstants.EDIT_IN_PROGRESS))   // If the record is current, don't touch it.
                {
                    recordMain.addNew();
                }
            }
        } catch (DBException ex)    {
            Debug.print(ex);
            ex.printStackTrace();
            m_objectID = null;
        }
        if (m_objectID == null)
            return null;
        else
            return recordMain;
    }
867912
@Override
  public final Future<WriteResponse> write(D record, @Nullable WriteCallback callback) {
    FutureWrappedWriteCallback wrappedWriteCallback = new FutureWrappedWriteCallback(callback);
    BufferedRecord<D> bufferedRecord = new BufferedRecord<>(record, wrappedWriteCallback);
    put(bufferedRecord);
    return wrappedWriteCallback;
  }
927511
@Override
	public void writeRecord(Record record) throws IOException {
		int numRecFields = record.getNumFields();
		int readPos;

		for (int i = 0; i < this.numFields; i++) {
			readPos = this.recordPositions[i];
			if (readPos < numRecFields) {
				Value v = record.getField(this.recordPositions[i], this.classes[i]);
				if (v != null) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
					this.wrt.write(v.toString());
				} else {
					if (this.lenient) {
						if (i != 0) {
							this.wrt.write(this.fieldDelimiter);
						}
					} else {
						throw new RuntimeException("Cannot serialize record with <null> value at position: " + readPos);
					}
				}

			} else {
				if (this.lenient) {
					if (i != 0) {
						this.wrt.write(this.fieldDelimiter);
					}
				} else {
					throw new RuntimeException("Cannot serialize record with out field at position: " + readPos);
				}
			}

		}

		// add the record delimiter
		this.wrt.write(this.recordDelimiter);
	}
886129
public void init(BaseDatabase database, Record record)
    {
        super.init(database, record);
        m_iRow = -1;        // resultSet row 0 = First row.
        m_iEOFRow = Integer.MAX_VALUE;  // Last valid row.
        m_iLastOrder = -1;
    }
908785
function() {
			if( this.dsRecord && this.dsRecord.isReady && Object.keys( this.dsRecord.get() ).length === 0 && this.state ) {
				this.dsRecord.set( this.state );
			}
		}
1287488
public void doSet(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = null;
            m_tableRemote.set(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
181518
def emitCurrentRecordChanged(self):
        
        record = unwrapVariant(self.itemData(self.currentIndex(), Qt.UserRole))
        if not Table.recordcheck(record):
            record = None
        
        self._currentRecord = record
        if not self.signalsBlocked():
            self._changedRecord = record
            self.currentRecordChanged.emit(record)
207656
public StringRecordBuilder<D> add(String record) {
    this.records.add(apply(checkNotNull(record, "record")));
    return this;
  }
1320627
public void add(Rec record) throws DBException
    {
        if (this.getRecord().getEditMode() != Constants.EDIT_ADD)
            throw new DBException(Constants.INVALID_RECORD);
        m_record = (FieldList)record;
        this.fieldsToData(record);
        this.doAdd(record);
        this.setDataSource(null);
        this.getRecord().setEditMode(Constants.EDIT_NONE);
    }