public int setUserID ( int iChangeType , boolean bDisplayOption ) { int iErrorCode = DBConstants . NORMAL_RETURN ; int iUserID = - 1 ; if ( this . getOwner ( ) . getRecordOwner ( ) != null ) if ( ( ( BaseApplication ) this . getOwner ( ) . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) != null ) if ( ( ( BaseApplication ) this . getOwner ( ) . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) . getUserID ( ) != null ) if ( ( ( BaseApplication ) this . getOwner ( ) . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) . getUserID ( ) . length ( ) > 0 ) iUserID = Integer . parseInt ( ( ( BaseApplication ) this . getOwner ( ) . getRecordOwner ( ) . getTask ( ) . getApplication ( ) ) . getUserID ( ) ) ; boolean bOldModified = this . getOwner ( ) . getField ( userIdFieldName ) . isModified ( ) ; boolean [ ] rgbEnabled = null ; if ( iChangeType == DBConstants . INIT_MOVE ) rgbEnabled = this . getOwner ( ) . getField ( userIdFieldName ) . setEnableListeners ( false ) ; iErrorCode = this . getOwner ( ) . getField ( userIdFieldName ) . setValue ( iUserID , bDisplayOption , iChangeType ) ; if ( iChangeType == DBConstants . INIT_MOVE ) { // Don't change the record on an init this . getOwner ( ) . getField ( userIdFieldName ) . setEnableListeners ( rgbEnabled ) ; this . getOwner ( ) . getField ( userIdFieldName ) . setModified ( bOldModified ) ; } return iErrorCode ; }
Set the user ID .