how to customize a Record type User Filter

I want to use record type User FIlter. However when I use the filter has around 50 options for the labels and options even if the actual grid only 2 or 3 options. Is there anyway to to limit the option of Label and Values according to Record Value.

a!recordFilterList(
name: "Assignee",
allowMultipleSelections: true,
options: a!localVariables(
local!assignees:a!queryRecordType(
recordType: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response',
fields: {
a!aggregationFields(
groupings: a!grouping(
field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assignee}assignee',
alias: "assignee"
)
)
},
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 500)
).data,
local!assigneesList:property(local!assignees,"assignee",null),
a!forEach(
items: local!assigneesList,
expression: a!recordFilterListOption(
id: fv!index,
name: fv!item,
filter: a!queryFilter(
field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assignee}assignee',
operator: "=",
value: fv!item
)
)
)
)
)

My Grid only has 3 items on them ad hence it shouldn't have more than 3 options of the User Filter options. However the options are more than 100 because on the database there are several options for the dropdown but not for this specif record

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Did you try to execute this logic in a separate expression to better understand what it is doing?

  • no basically,
    I am trying to lower the options on this record user filter

  • 0
    Certified Lead Developer
    in reply to sergiog132707

    Sure, but as the items you create the options from are coming from that query, you might first want to investigate that aggregation.

  • I can get the correct query.
    is this one:
    local!assignees:a!queryRecordType(
    recordType: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response',
    fields: {
    a!aggregationFields(
    groupings: a!grouping(
    field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assignee}assignee',
    alias: "assignee"
    )
    )
    },
    filters: {
    a!queryFilter(
    field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assmtFocusAreaAudId}assmtFocusAreaAudId',
    operator: "in",
    value: tointeger(
    index(
    local!assmtFocusAreaAuds,
    "assmtFocusAreaAudId",
    {}
    )
    )
    ),
    a!queryFilter(
    field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{compliantStatus}compliantStatus',
    operator: "=",
    value: "No"
    ),
    a!queryFilter(
    field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{stmtTypeId}stmtTypeId',
    operator: "=",
    value: cons!ROAP_INT_COMPLIANCE_STMT_STMT_TYPE
    )
    },
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 500)
    ).data,

    as you can see I have a local variable call local!assmtFocusAreaAuds.
    I have no idea how to set that up on the Record type User Filter

  • 0
    Certified Lead Developer
    in reply to sergiog132707

    So, when that query returns the data exactly as you expect, then you can turn that into a user filter as you do in the code you posted above. Where are you stuck?

    BTW:

  • yes,
    I have the query that returns what I want:

    a!queryRecordType(
        recordType: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response',
        fields: {
          a!aggregationFields(
            groupings: a!grouping(
              field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assignee}assignee',
              alias: "assignee"
            )
          )
        },
        filters: {
          a!queryFilter(
            field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{assmtFocusAreaAudId}assmtFocusAreaAudId',
            operator: "in",
            value: tointeger(
              index(
                local!assmtFocusAreaAuds,
                "assmtFocusAreaAudId",
                {}
              )
            )
          ),
          a!queryFilter(
            field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{compliantStatus}compliantStatus',
            operator: "=",
            value: "No"
          ),
          a!queryFilter(
            field: 'recordType!{4390cf3b-8f80-4bfd-adfa-b06cb2562f7d}Job Corps Response.fields.{stmtTypeId}stmtTypeId',
            operator: "=",
            value: cons!ROAP_INT_COMPLIANCE_STMT_STMT_TYPE
          )
        },
        pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 500)
      ).data

    however I want to use the Record Type User Filter. 

    I have no idea how to set up a variable that is going to change according to the record is being display. Am I force to only use a Costume Filter?

  • 0
    Certified Lead Developer
    in reply to sergiog132707

    I have a hard time trying to understand what you try to achieve.

    What exactly do you mean with "change according to the record is being display"?

    But maybe the answer is more simple, as user filters do not support any way to react on the data being displayed.

Reply Children