This commit is contained in:
2021-02-05 23:56:18 +00:00
parent f9dd2b96e7
commit 32abdf3475

View File

@@ -112,21 +112,28 @@ namespace AyaNova.DataList
{
DataListField AyaField = new DataListField();
var cust = dr.GetString(qSelect.map[f.GetSqlValueColumnName()]);
if (!string.IsNullOrWhiteSpace(cust))
//could be null
var rawValue = dr.GetValue(qSelect.map[f.GetSqlValueColumnName()]);
if (rawValue != null)
{
JObject j = JObject.Parse(cust);
//convert field name to cust name then get value
var InternalCustomFieldName = FormFieldReference.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
//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;
string cust = rawValue.ToString();
if (!string.IsNullOrWhiteSpace(cust))
{
JObject j = JObject.Parse(cust);
//convert field name to cust name then get value
var InternalCustomFieldName = FormFieldReference.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
//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);
row.Add(AyaField);
}else{
AyaField.v=null;
}
}
/*