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 hasFilterVariable = false;
if (field.possibleValueSourceName)
{
//////////////////////////////////////////////////////////////////////////////////
@ -123,6 +124,9 @@ class FilterUtils
//////////////////////////////////////////////////////////////////////////////////
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")
{
hasFilterVariable = true;
@ -142,11 +146,7 @@ class FilterUtils
}
}
if (hasFilterVariable)
{
values[0] = new FilterVariableExpression({fieldName: field.name, valueIndex: 0});
}
else if (values && values.length)
if (values && values.length)
{
for (let i = 0; i < values.length; i++)
{
@ -245,6 +245,10 @@ class FilterUtils
{
return (new ThisOrLastPeriodExpression(value));
}
else if (value.type == "FilterVariableExpression")
{
return (new FilterVariableExpression(value));
}
}
return (null);