public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        UserField field = (UserField)this.getOwner();
        Person recPerson = (Person)field.getRecord();
        if (field.isNull())
        {
            
        }
        else
        {
            ContactTypeModel recContactType = (ContactTypeModel)this.getContactType(recPerson);
            if (recContactType != null)
            {   // Always
                UserInfo recUserInfo = (UserInfo)field.getReference();
                if (recUserInfo != null)
                    if ((recUserInfo.getEditMode() == DBConstants.EDIT_CURRENT) || (recUserInfo.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
                    {
                        recUserInfo.addPropertyListeners();
                        int iOldOpenMode = recUserInfo.setOpenMode(recUserInfo.getOpenMode() & ~DBConstants.OPEN_READ_ONLY);
                        try {
                            recUserInfo.edit();
                            recUserInfo.getField(UserInfo.CONTACT_TYPE_ID).moveFieldToThis(((Record)recContactType).getCounterField());
                            recUserInfo.getField(UserInfo.CONTACT_ID).moveFieldToThis(recPerson.getCounterField());
                            recUserInfo.set();
                        } catch (DBException ex) {
                            ex.printStackTrace();
                        } finally {
                            recUserInfo.setOpenMode(iOldOpenMode);
                        }
                    }
            }
        }
        return super.fieldChanged(bDisplayOption, iMoveMode);
    }
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { UserField field = ( UserField ) this . getOwner ( ) ; Person recPerson = ( Person ) field . getRecord ( ) ; if ( field . isNull ( ) ) { } else { ContactTypeModel recContactType = ( ContactTypeModel ) this . getContactType ( recPerson ) ; if ( recContactType != null ) { UserInfo recUserInfo = ( UserInfo ) field . getReference ( ) ; if ( recUserInfo != null ) if ( ( recUserInfo . getEditMode ( ) == DBConstants . EDIT_CURRENT ) || ( recUserInfo . getEditMode ( ) == DBConstants . EDIT_IN_PROGRESS ) ) { recUserInfo . addPropertyListeners ( ) ; int iOldOpenMode = recUserInfo . setOpenMode ( recUserInfo . getOpenMode ( ) & ~ DBConstants . OPEN_READ_ONLY ) ; try { recUserInfo . edit ( ) ; recUserInfo . getField ( UserInfo . CONTACT_TYPE_ID ) . moveFieldToThis ( ( ( Record ) recContactType ) . getCounterField ( ) ) ; recUserInfo . getField ( UserInfo . CONTACT_ID ) . moveFieldToThis ( recPerson . getCounterField ( ) ) ; recUserInfo . set ( ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } finally { recUserInfo . setOpenMode ( iOldOpenMode ) ; } } } } return super . fieldChanged ( bDisplayOption , iMoveMode ) ; }
FieldChanged Method.