public int doSetData ( Object data , boolean bDisplayOption , int iMoveMode ) { int iErrorCode = DBConstants . NORMAL_RETURN ; if ( data != null ) { iErrorCode = this . getFieldCopy ( ) . setData ( data , DBConstants . DONT_DISPLAY , DBConstants . READ_MOVE ) ; if ( iErrorCode != DBConstants . NORMAL_RETURN ) return iErrorCode ; // Never! if ( ! this . getFieldCopy ( ) . equals ( this . getOwner ( ) ) ) { // Only check if the value changes // Get this value double dValue = ( ( NumberField ) this . getFieldCopy ( ) ) . getValue ( ) ; // Check the range Task task = null ; BaseApplication application = null ; if ( this . getOwner ( ) . getRecord ( ) . getRecordOwner ( ) != null ) task = this . getOwner ( ) . getRecord ( ) . getRecordOwner ( ) . getTask ( ) ; if ( task != null ) application = ( BaseApplication ) task . getApplication ( ) ; //if (application == null) // application = (BaseApplication)BaseApplet.getSharedInstance().getApplication(); if ( m_dStartRange != Double . MIN_VALUE ) if ( dValue < m_dStartRange ) return task . setLastError ( MessageFormat . format ( application . getResources ( ResourceConstants . ERROR_RESOURCE , true ) . getString ( TOO_SMALL ) , m_dStartRange ) ) ; if ( m_dEndRange != Double . MAX_VALUE ) if ( dValue > m_dEndRange ) return task . setLastError ( MessageFormat . format ( application . getResources ( ResourceConstants . ERROR_RESOURCE , true ) . getString ( TOO_LARGE ) , m_dEndRange ) ) ; } } return super . doSetData ( data , bDisplayOption , iMoveMode ) ; // Move; it's okay }
Move the physical binary data to this field . If this value is out of range return an error .