This commit is contained in:
2020-02-14 23:34:59 +00:00
parent 5acf0b8a80
commit 798e63c396
4 changed files with 37 additions and 27 deletions

View File

@@ -37,6 +37,7 @@ namespace AyaNova.DataList
sb.Append(" AS df");
bool CustomFieldIncluded = false;
foreach (string ColumnName in listViewFieldList)
{
//skip the df column, it's already been processed above
@@ -53,15 +54,25 @@ namespace AyaNova.DataList
if (o != null)
{//Ignore missing fields in production
sb.Append(", ");
sb.Append(o.GetSqlValueColumnName());
if (o.IsCustomField && !CustomFieldIncluded)
{ //if any are custom field then add custom fields column to query
CustomFieldIncluded=true;
//does it also have an ID column?
if (!string.IsNullOrWhiteSpace(o.SqlIdColumnName))
}
else
{
sb.Append(", ");
sb.Append(o.SqlIdColumnName);
sb.Append(o.GetSqlValueColumnName());
//does it also have an ID column?
if (!string.IsNullOrWhiteSpace(o.SqlIdColumnName))
{
sb.Append(", ");
sb.Append(o.SqlIdColumnName);
}
}
}
}