/** * Get the record name that this field references. * @return String Name of the record. */ public String getReferenceRecordName() { if (m_recordReference != null) return this.getReferenceRecord().getTableNames(false); else { // This code just takes a guess if (this.getClass().getName().indexOf("Field") != -1) return this.getClass().getName().substring(Math.max(0, this.getClass().getName().lastIndexOf('.') + 1), this.getClass().getName().indexOf("Field")); else if (this.getFieldName(false, false).indexOf("ID") != -1) return this.getFieldName(false, false).substring(0, this.getFieldName(false, false).indexOf("ID")); else this.getFieldName(false, false); } return Constants.BLANK; // Never } /**
/** * Get the record name that this field references. * @return String Name of the record. */ public String getReferenceRecordName() { if (m_recordReference != null) return this.getReferenceRecord().getTableNames(false); else { // This code just takes a guess if (this.getClass().getName().indexOf("Field") != -1) return this.getClass().getName().substring(Math.max(0, this.getClass().getName().lastIndexOf('.') + 1), this.getClass().getName().indexOf("Field")); else if (this.getFieldName(false, false).indexOf("ID") != -1) return this.getFieldName(false, false).substring(0, this.getFieldName(false, false).indexOf("ID")); else this.getFieldName(false, false); } return Constants.BLANK; // Never } /**
/** * Get the record name that this field references. * @return String Name of the record. */ public String getReferenceRecordName() { if (m_recordReference != null) return this.getReferenceRecord().getTableNames(false); else { // This code just takes a guess if (this.getClass().getName().indexOf("Field") != -1) return this.getClass().getName().substring(Math.max(0, this.getClass().getName().lastIndexOf('.') + 1), this.getClass().getName().indexOf("Field")); else if (this.getFieldName(false, false).indexOf("ID") != -1) return this.getFieldName(false, false).substring(0, this.getFieldName(false, false).indexOf("ID")); else this.getFieldName(false, false); } return Constants.BLANK; // Never } /**
/** * Sync the contact type record to the main value. */ public void syncContactTypeToMain() { ReferenceField fldContactType = (ReferenceField)this.getMainRecord().getField(MessageDetail.kContactTypeID); String strContactTypeParam = fldContactType.getFieldName(); this.syncRecordToMainField(fldContactType, null, strContactTypeParam); } /**
/** * SyncContactTypeToMain Method. */ public void syncContactTypeToMain() { ReferenceField fldContactType = (ReferenceField)this.getMainRecord().getField(MessageDetail.kContactTypeID); String strContactTypeParam = fldContactType.getFieldName(); this.syncRecordToMainField(fldContactType, null, strContactTypeParam); } /**
String strFieldName = fldProfileTypeID.getFieldName(); String strValue = Integer.toString(fldProfileTypeID.getIDFromCode("Contact")); if (strValue != null)
String strFieldName = fldProfileTypeID.getFieldName(); String strValue = Integer.toString(fldProfileTypeID.getIDFromCode("Contact")); if (strValue != null)
/** * Get the command string to restore screen. */ public String getScreenURL() { String strURL = super.getScreenURL(); ReferenceField fldContactType = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.kContactTypeID); String strContactTypeParam = fldContactType.getFieldName(); if (!fldContactType.isNull()) { String strContactType = fldContactType.getReference().getField(ContactType.kCode).toString(); strURL = this.addURLParam(strURL, strContactTypeParam, strContactType); } return strURL; } /**
/** * OpenHeaderRecord Method. */ public Record openHeaderRecord() { Record record = null; this.syncContactTypeToMain(); // Read in the current contact record ReferenceField fldContactType = (ReferenceField)this.getMainRecord().getField(MessageDetail.kContactTypeID); ContactType recContactType = (ContactType)fldContactType.getReferenceRecord(this); String strHeaderRecordName = null; if (recContactType != null) strHeaderRecordName = recContactType.getField(ContactType.kCode).toString(); if ((strHeaderRecordName == null) || (strHeaderRecordName.length() == 0)) strHeaderRecordName = this.getProperty(fldContactType.getFieldName()); record = recContactType.makeRecordFromRecordName(strHeaderRecordName, this); if (record != null) ((ReferenceField)this.getMainRecord().getField(MessageDetail.kPersonID)).setReferenceRecord(record); return record; } /**
/** * Open the header record. * @return The new header record. */ public Record openHeaderRecord() { Record record = null; this.syncContactTypeToMain(); // Read in the current contact record ReferenceField fldContactType = (ReferenceField)this.getMainRecord().getField(MessageDetail.kContactTypeID); ContactType recContactType = (ContactType)fldContactType.getReferenceRecord(this); recContactType = (ContactType)fldContactType.getReference(); // Being careful String strHeaderRecordName = null; if (recContactType != null) strHeaderRecordName = recContactType.getField(ContactType.kCode).toString(); if ((strHeaderRecordName == null) || (strHeaderRecordName.length() == 0)) strHeaderRecordName = this.getProperty(fldContactType.getFieldName()); record = recContactType.makeRecordFromRecordName(strHeaderRecordName, this); if (record != null) ((ReferenceField)this.getMainRecord().getField(MessageDetail.kPersonID)).setReferenceRecord(record); return record; } /**
/** * OpenHeaderRecord Method. */ public Record openHeaderRecord() { Record record = null; //this.syncContactTypeToMain(); // Read in the current contact record if (this.getScreenRecord() == null) this.setScreenRecord(this.addScreenRecord()); ReferenceField fldContactType = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.kContactTypeID); ContactType recContactType = (ContactType)fldContactType.getReferenceRecord(this); recContactType = (ContactType)fldContactType.getReference(); // Being careful String strHeaderRecordName = null; if (recContactType != null) strHeaderRecordName = recContactType.getField(ContactType.kCode).toString(); if ((strHeaderRecordName == null) || (strHeaderRecordName.length() == 0)) strHeaderRecordName = this.getProperty(fldContactType.getFieldName()); record = recContactType.makeRecordFromRecordName(strHeaderRecordName, this); if (record != null) ((ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.kContactID)).setReferenceRecord(record); return record; } /**
Map<String,Object> properties = new Hashtable<String,Object>(); ReferenceField fldRequestTypeID = (ReferenceField)this.getScreenRecord().getField(BookingItineraryScreenRecord.REQUEST_TYPE_ID); properties.put(fldRequestTypeID.getFieldName(), Integer.toString(fldRequestTypeID.getIDFromCode(RequestType.MANUAL))); ReferenceField fldContactTypeID = (ReferenceField)this.getScreenRecord().getField(BookingItineraryScreenRecord.CONTACT_TYPE_ID); properties.put(fldContactTypeID.getFieldName(), Integer.toString(fldContactTypeID.getIDFromCode(Profile.PROFILE_FILE))); Record record = ((ReferenceField)this.getScreenRecord().getField(BookingItineraryScreenRecord.MESSAGE_PROCESS_INFO_ID)).getReferenceRecord(); GridScreen screen = (GridScreen)record.makeScreen(null, parentScreen, ScreenConstants.SELECT_MODE, true, true, true, true, properties);