Skip to main content
October 19, 2021
Question

User Filter in Record

  • October 19, 2021
  • 3 replies
  • 0 views

Hello All,

In the code snippet. the data is coming from a view configured.

The field sendingName_RSO contains a list of names and the field will hold more than one value.

Now I have added a user filter in the Record having a dropdown values of users from the constant defined.

When I give "includes" in the a!queryfield to get all the records assigned to a particular user, it gives the below error

Error Evaluating UI Expression
Expression evaluation error [evaluation ID = ad938:9cef1] in rule 'recordhomepage' (called by rule 'sitehomepage') : Cannot apply operator [INCLUDES] to field [sendingName_RSO] when comparing to value [TypedValue[it=4,v=firstname.lastname]].

I wanted to check if there any way we can pass "includes" or "in" in the a!queryfilter in an record user filter.

a!localVariables(
local!sendingRSO: getdistinctusers(cons!ALL_GROUPS[1]),
a!recordFilterList(
name: "Sending RSO",
options: a!forEach(
items: local!sendingRSO,
expression: a!recordFilterListOption(
id: fv!index,
name: fv!item,
filter: a!queryFilter(
field: 'recordType!{recordName}Request.fields.{sendingName_RSO}sendingName_RSO',
operator: "=",
value: fv!item
)
)
),
allowMultipleSelections: true()
)
)

3 replies

danny.verb
October 19, 2021

On line 13, wrap 'fv!item' in tostring()

October 20, 2021

This works and thank you very much for the solution.

csteward
October 19, 2021

To add, we see this regularly with loosely-typed local variables.  Some functions are better at type casting than others, so as Danny mentions if you force to string type with fn!tostring(), should be good to go.