Don't crash app home if count comes back null; don't crash table if no field named 'id'

This commit is contained in:
2022-10-24 15:42:47 -05:00
parent 0a9577eb4a
commit 7aa3521775
2 changed files with 37 additions and 17 deletions

View File

@ -592,9 +592,26 @@ function EntityList({table, launchProcess}: Props): JSX.Element
row[field.name] = value;
});
if(!row["id"])
{
row["id"] = row[tableMetaData.primaryKeyField];
}
rows.push(row);
});
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// do this secondary check for columnsToRender - in case we didn't have any rows above, and our check for string isn't enough. //
// ... shouldn't this be just based on the field definition anyway... ? plus adornments? //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
fields.forEach((field) =>
{
if(field.possibleValueSourceName)
{
columnsToRender[field.name] = true;
}
});
if(columnsModel.length == 0)
{
setupGridColumns(columnsToRender);
@ -877,21 +894,6 @@ function EntityList({table, launchProcess}: Props): JSX.Element
return "";
}
function getRecordIdsForProcess(): string | QQueryFilter
{
if (selectFullFilterState === "filter")
{
return (buildQFilter(filterModel));
}
if (selectedIds.length > 0)
{
return (selectedIds.join(","));
}
return "";
}
const openModalProcess = (process: QProcessMetaData = null) =>
{
if (selectFullFilterState === "filter")