a!queryFilter by multiple fields

#Records

Hi everyone,

I'm trying to create a filter on my Records list that filters down records I have touched. e.g. A record that my username exists in the "createdBy" field OR the "modifiedBy" field.

Currently I have two a!facetOption, one that filters the loggedinuser() by createdBy and one that looks at modified by.

My goal is to create a single filter option instead of two, called My Records, that will look at either column and return the union of those records.

The reason why I do not want to filter on just modifiedBy is that if another user modifies the record, it will disappear from the list.

The requirement is that the user sees a filtered list of any record that they have participated in creating/editing in the past.

How do I do this with my current 1 table structure with two columns createdBy & modifiedBy?

Attached is the current a!facet I am using.

OriginalPostID-266069



  Discussion posts and replies are publicly visible

  • I think you can use this workaround:

    -create a rule called rule!filter with a ri!field like this:
    a!queryFilter(
    field: ri!filter
    operator "="
    value: loggedinuser()

    -on the record create a multiple text ri!fields with value "createdBy"; "modifiedBy" and after use this code:
    a!facet(
    name: "My Records,
    options: {
    id: 1,
    name: "My records"
    filter: apply(
    rule!filter,
    ri!fields
    )
    },
    isVisible: true
    )