public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { // Read a valid record int value = ( int ) ( ( NumberField ) this . getOwner ( ) ) . getValue ( ) ; if ( ( value / 10 ) % 7 != value - ( value / 10 * 10 ) ) { Task task = null ; if ( this . getOwner ( ) != null ) if ( this . getOwner ( ) . getRecord ( ) != null ) task = this . getOwner ( ) . getRecord ( ) . getTask ( ) ; String strError = "Incorrect Magic number" ; if ( task != null ) { strError = ( ( BaseApplication ) task . getApplication ( ) ) . getResources ( ResourceConstants . ERROR_RESOURCE , true ) . getString ( strError ) ; return task . setLastError ( strError ) ; } return DBConstants . ERROR_RETURN ; } return super . fieldChanged ( bDisplayOption , iMoveMode ) ; }
The Field has Changed . Make sure this is a valid modulus - 7 number if not return an error .