CE-1068: fixed bug around filter variables on possible value

This commit is contained in:
Tim Chamberlain
2024-05-01 13:43:41 -05:00
parent f3d08ef683
commit e0f689544d

View File

@ -110,6 +110,7 @@ class FilterUtils
let values = criteria.values; let values = criteria.values;
let hasFilterVariable = false; let hasFilterVariable = false;
if (field.possibleValueSourceName) if (field.possibleValueSourceName)
{ {
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
@ -123,6 +124,9 @@ class FilterUtils
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
if (values && values.length > 0 && values[0] !== null && values[0] !== undefined && values[0] !== "") if (values && values.length > 0 && values[0] !== null && values[0] !== undefined && values[0] !== "")
{ {
////////////////////////////////////////////////////////////////////////
// do not do this lookup if the field is a filter variable expression //
////////////////////////////////////////////////////////////////////////
if (values[0].type && values[0].type == "FilterVariableExpression") if (values[0].type && values[0].type == "FilterVariableExpression")
{ {
hasFilterVariable = true; hasFilterVariable = true;
@ -142,11 +146,7 @@ class FilterUtils
} }
} }
if (hasFilterVariable) if (values && values.length)
{
values[0] = new FilterVariableExpression({fieldName: field.name, valueIndex: 0});
}
else if (values && values.length)
{ {
for (let i = 0; i < values.length; i++) for (let i = 0; i < values.length; i++)
{ {
@ -245,6 +245,10 @@ class FilterUtils
{ {
return (new ThisOrLastPeriodExpression(value)); return (new ThisOrLastPeriodExpression(value));
} }
else if (value.type == "FilterVariableExpression")
{
return (new FilterVariableExpression(value));
}
} }
return (null); return (null);