public boolean readSameRecord(Record recordCurrent, boolean bWriteIfChanged, boolean bRefreshIfChanged)
    { // Read the same record as the supplied BaseTable
        try   {
            Record record = null;
            Object bookmark = null;
            if (recordCurrent != null)
                bookmark = recordCurrent.getHandle(DBConstants.DATA_SOURCE_HANDLE);
            if (bookmark != null)
            {
                if (recordCurrent.getEditMode() == Constants.EDIT_IN_PROGRESS)
                    if (recordCurrent.isModified())
                {
                    if (bRefreshIfChanged)
                        recordCurrent.writeAndRefresh();    // Update before reading other
                    else if (bWriteIfChanged)
                        recordCurrent.set();    // Update before reading other
                }
                record = this.setHandle(bookmark, DBConstants.DATA_SOURCE_HANDLE);
            }
            if (record != null)
                return true;
            this.addNew();  // Not found, start with a NEW record!
        } catch (DBException ex)    {
            ex.printStackTrace();
        }
        return false; // Not found
    }
public boolean readSameRecord ( Record recordCurrent , boolean bWriteIfChanged , boolean bRefreshIfChanged ) { try { Record record = null ; Object bookmark = null ; if ( recordCurrent != null ) bookmark = recordCurrent . getHandle ( DBConstants . DATA_SOURCE_HANDLE ) ; if ( bookmark != null ) { if ( recordCurrent . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) if ( recordCurrent . isModified ( ) ) { if ( bRefreshIfChanged ) recordCurrent . writeAndRefresh ( ) ; else if ( bWriteIfChanged ) recordCurrent . set ( ) ; } record = this . setHandle ( bookmark , DBConstants . DATA_SOURCE_HANDLE ) ; } if ( record != null ) return true ; this . addNew ( ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } return false ; }
Read the record in this BaseTable.
<p/>Note: If the recordCurrent has an edit in progress, it is not updated first,
so you should update the current record if you want the new record to show the updates.
<br/>Note: Be careful of concurrency issues... Use OnSelectHandler to update from one screen
to another.
@param currentRecord record that has the current record that I need to read.
@return true if successful.