For binary fields, set the current state.
@param state The state to set this field.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN).
333498
public int setState(boolean state, boolean bDisplayOption, int iMoveMode)
    {       // Must be overidden
        if (this.getNextConverter() != null)
            return this.getNextConverter().setState(state, bDisplayOption, iMoveMode);
        else
            return super.setState(state, bDisplayOption, iMoveMode);
    }
4474
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        int result = DBConstants.NORMAL_RETURN;
        Record record = m_fldTarget.getRecord();
        boolean bSetDirty = true;
        if (m_bIfNewRecord) if (record.getEditMode() == Constants.EDIT_ADD)
            bSetDirty = true;
        if (m_bIfCurrentRecord) if ((record.getEditMode() == Constants.EDIT_CURRENT) || (record.getEditMode() == Constants.EDIT_IN_PROGRESS))
            bSetDirty = true;
        if (bSetDirty)
        {
            m_fldTarget.setModified(true);
            result = record.handleRecordChange(m_fldTarget, DBConstants.FIELD_CHANGED_TYPE, bDisplayOption);    // Tell table that I'm getting changed (if not locked)
        }
        return result;
    }
812747
public int fieldChanged(boolean bDisplayOption, int moveMode)
    {
        String source = this.getOwner().getString();
        String soundex = this.soundex(source.substring(0, Math.min(4, source.length())));
        if (soundex == null)
            return DBConstants.NORMAL_RETURN;
        short hashValue = this.hashSound(soundex);
        BaseField field = this.getOwner().getRecord().getField(m_iFieldSeq);
        return field.setValue(hashValue, bDisplayOption, moveMode);   // Move even if no change
    }
141938
public int setValue(double value, boolean bDisplayOption, int moveMode)
    {           // Set this field's value
        Integer tempLong = new Integer((int)value);
        int iErrorCode = this.setData(tempLong, bDisplayOption, moveMode);
        return iErrorCode;
    }
620694
public boolean respondsToMode(int iMoveMode)
    {
        if (iMoveMode == DBConstants.SCREEN_MOVE)
            return m_bScreenMove;
        if (iMoveMode == DBConstants.INIT_MOVE)
            return m_bInitMove;
        if (iMoveMode == DBConstants.READ_MOVE)
            return m_bReadMove;
        return false;
    }
49492
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
    {
        if ((strValue == null) || (strValue.length() == 0))
            return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
        if (TEN_SPACES.equals(strValue))
            return DBConstants.NORMAL_RETURN;
        return super.setString(strValue, bDisplayOption, iMoveMode);
    }
1328758
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {   // User selected an item... Read it in!
        int iErrorCode = this.moveToIndex(index);
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption);   // Record selected!!!
        // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!!
        FieldInfo field = this.getField();
        if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null)
        {
            if (field instanceof ReferenceField)
                ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode);
            else if (field instanceof StringField)
            {
                {
                    if (displayFieldName != null)
                        return field.setString(m_record.getField(displayFieldName).toString());
                    else
                        return field.setString(m_record.getField(m_iFieldSeq).toString());
                }
            }
        }
        return iErrorCode;
    }
405998
public int initField(boolean bDisplayOption)                    // Init this field override for other value
    {
        if ((this.getDefault() == null) || (this.getDefault() instanceof String))
            return this.setString((String)this.getDefault(), bDisplayOption, Constants.INIT_MOVE);   // zero out the field
        return this.setData(this.getDefault(), bDisplayOption, Constants.INIT_MOVE);
    }
1182455
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        int iErrorCode = this.moveIt(bDisplayOption, iMoveMode);
        if (iErrorCode != DBConstants.NORMAL_RETURN)
            if (this.getOwner() != m_fldSource)
                if (this.getOwner() != m_fldDest)
                    iErrorCode = DBConstants.NORMAL_RETURN; // If the source and dest are unrelated this this, don't return an error (and revert this field)
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            iErrorCode = super.fieldChanged(bDisplayOption, iMoveMode);
        return iErrorCode;
    }
652674
public void doValidRecord(boolean bDisplayOption) // Init this field override for other value
    {
    	Record record = this.getOwner();
    	BaseDatabase database = record.getTable().getDatabase();
    	m_bEnableOnValid = true;

    	int counter = (int)record.getCounterField().getValue();
    	String startingID = database.getProperty(BaseDatabase.STARTING_ID);
    	String endingID = database.getProperty(BaseDatabase.ENDING_ID);
    	if (startingID != null)
    		if (counter < Integer.parseInt(Converter.stripNonNumber(startingID)))
    			m_bEnableOnValid = false;
    	if (endingID != null)
    		if (counter > Integer.parseInt(Converter.stripNonNumber(endingID)))
    			m_bEnableOnValid = false;
//    	System.out.println("start, end: " + startingID + "  " + endingID);
        super.doValidRecord(bDisplayOption);
    }
709997
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        if (m_screenField == null)
            this.lookupSField();
        if (m_bChangeIfNull != null)
        {
            if ((m_bChangeIfNull.booleanValue()) && (!this.getOwner().isNull()))
                return DBConstants.NORMAL_RETURN;
            if ((!m_bChangeIfNull.booleanValue()) && (this.getOwner().isNull()))
                return DBConstants.NORMAL_RETURN;
        }
        if (m_screenField != null)
            m_screenField.requestFocus();
        return DBConstants.NORMAL_RETURN;
    }
262654
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {
        String tempString = this.convertIndexToString(index);
        return this.setString(tempString, bDisplayOption, iMoveMode); // Move value to this field
    }
929193
def set_state(self, state):
        
        _field = self.binary_state_name()
        values = {"desired_state": {_field: state}}
        response = self.api_interface.local_set_state(self, values, type_override="binary_switche")
        self._update_state_from_response(response)
858669
public void doNewRecord(boolean bDisplayOption)
    {
        super.doNewRecord(bDisplayOption);
        if (this.getOwner().isOpen())   // Don't do first time!
        {
            String strUserID = ((BaseApplication)this.getOwner().getRecordOwner().getTask().getApplication()).getUserID();
            int iUserID = -1;
            if ((strUserID != null) && (strUserID.length() > 0))
                iUserID = Integer.parseInt(strUserID);
            this.getOwner().getField(UserInfo.ID).setValue(iUserID);
            String strOldKey = this.getOwner().getKeyName();
            try   {
                this.getOwner().setKeyArea(UserInfo.ID_KEY);
                if (!this.getOwner().seek("="))
                {
                    this.getOwner().addNew(); // Make a new one
                }
            } catch (DBException ex)    {
                ex.printStackTrace();
            } finally   {
                this.getOwner().setKeyArea(strOldKey);
            }
        }
    }
1326073
public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
    {
        if (m_strTargetValue != null)
        {
            String fieldString = this.getString();
            if (m_boolMaskValue.booleanValue())
            {
                int index = fieldString.indexOf(m_strTargetValue);
                if (bState == m_bTrueIfMatch)
                {   // Add target string to field!
                    if (index == -1) // Is the target value in the field string?
                    {   // No, Add it!
                        fieldString = m_strTargetValue + fieldString;        // Add the field to the string
                    }
                }
                else
                {   // Take target field out of field
                    if (index != -1)    // Is the target value in the field string
                    {   // Yes, Take it out!
                        fieldString = fieldString.substring(0, index) + fieldString.substring(index+1);   // Strip the field to the string
                    }
                }
            }
            else
                fieldString = m_strTargetValue; // Set to the value
            return this.setString(fieldString, bDisplayOption, iMoveMode);
        }
        else if (m_fldTargetValue != null)
        {
            if (bState == m_bTrueIfMatch)
            	return ((BaseField)this.getField()).moveFieldToThis(m_fldTargetValue, bDisplayOption, iMoveMode);
            else
                return ((BaseField)this.getField()).setString(null);	// Unchecked = clear it.
        }
        else    // Target = null
        {
            if (bState == m_bTrueIfMatch)
                return ((BaseField)this.getField()).setString(null);
            else
                return DBConstants.NORMAL_RETURN; //?
        }
    }
1285318
public int setValue(double value, boolean bDisplayOption, int moveMode)
    {           // Set this field's value
        Short tempshort = new Short((short)value);
        int errorCode = this.setData(tempshort, bDisplayOption, moveMode);
        return errorCode;
    }
399406
public int setTime(java.util.Date time, boolean bDisplayOption, int iMoveMode)
    {
        java.util.Date m_DateTime = (java.util.Date)m_data;
        int iYear = DBConstants.FIRST_YEAR;
        int iMonth = DBConstants.FIRST_DAY;
        int iDate = DBConstants.FIRST_MONTH;
        if (m_DateTime != null) //|| (m_CurrentLength == 0))
        {
            m_calendar.setTime(m_DateTime);
            iYear = m_calendar.get(Calendar.YEAR);
            iMonth = m_calendar.get(Calendar.MONTH);
            iDate = m_calendar.get(Calendar.DATE);
        }
        m_calendar.setTime(time);
        int iHour = m_calendar.get(Calendar.HOUR_OF_DAY);
        int iMinute = m_calendar.get(Calendar.MINUTE);
        int iSecond = m_calendar.get(Calendar.SECOND);
        m_calendar.set(iYear, iMonth, iDate, iHour, iMinute, iSecond);
        java.util.Date dateNew = m_calendar.getTime();
        return this.setDateTime(dateNew, bDisplayOption, iMoveMode);
    }