private object GetFieldValueForRecord(FieldMap fieldMap, ClarifyDataRow record) { if (fieldMap.FieldValueMethod != null) { return(fieldMap.FieldValueMethod()); } if (fieldMap.GlobalListConfig != null) { var globalListConfig = fieldMap.GlobalListConfig; var globalList = _listCache.GetList(globalListConfig.ListName); if (globalListConfig.SelectionFromRelation != null) { var listDatabaseIdentifier = Convert.ToInt32(GetGenericFieldValue(fieldMap, record)); globalList.SetSelection(listDatabaseIdentifier); } if (globalListConfig.TitleToDisplayTitleMap != null) { var map = globalListConfig.TitleToDisplayTitleMap; globalList.PopulateDisplayTitles(map); } return(globalList); } if (fieldMap.UserDefinedList != null) { return(_listCache.GetHgbstList(fieldMap.UserDefinedList)); } if (fieldMap.MapFieldValuesToObject != null) { var fieldValues = GetGenericFieldValues(fieldMap, record); return(fieldMap.MapFieldValuesToObject(fieldValues)); } if (fieldMap.StringToFieldValueMethod != null) { var fieldValue = GetGenericFieldValue(fieldMap, record); var stringValue = Convert.ToString(fieldValue); return(fieldMap.StringToFieldValueMethod(stringValue)); } return(GetGenericFieldValue(fieldMap, record)); }