This commit is contained in:
2020-02-27 19:14:46 +00:00
parent 30e0ef3949
commit 5b0ce90157

View File

@@ -89,11 +89,11 @@ namespace AyaNova.DataList
{
List<AyaFieldData> row = new List<AyaFieldData>(returnRowColumnCount);
//INSERT REMAINING FIELDS FROM TEMPLATE INTO THE RETURN ROWS LIST
foreach (string TemplateField in ListViewFieldList)
{
//get the AyaObjectFieldDefinition
AyaDataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(x => x.FieldKey == TemplateField);
if (f.IsCustomField)
@@ -106,7 +106,14 @@ namespace AyaNova.DataList
JObject j = JObject.Parse(cust);
//convert field name to cust name then get value
var InternalCustomFieldName = AyaFormFieldDefinitions.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
AyaField.v = j[InternalCustomFieldName].Value<object>();
//Sometimes a custom field is specified but doesn't exist in the collection so don't assume it's there
// AyaField.v = j[InternalCustomFieldName].Value<object>();
JToken o = j[InternalCustomFieldName];
if (o != null)
AyaField.v = o.Value<object>();
else
AyaField.v = null;
row.Add(AyaField);
}