a!recordFilterList in Order fulfillment app

Hi,

Can anyone please help me to understand the below code.

How is defaultOption:"Me" differ from currentUser(my account)

a!recordFilterList(
  name: "Assignee",
  defaultOption: "Me",
  options: {
    /* We modify the standard logic to account for the "LoggedIn User" user */
    a!forEach(
      items: append(cons!VOF_ALL_ANALYSTS, {"LoggedIn User", null}),
      expression: if(
        fv!isLast,
        a!recordFilterListOption(
          id: fv!index,
          name: "Unassigned",
          filter: a!queryFilter(
            field: 'recordType!{c5bfe4ef-1564-4630-a19f-cbdaa1880a48}HZN_JC_JobCosting_recordtype1.fields.{0293d097-e030-4431-9bcc-f5742790bb82}assignee',
            operator: "is null"
          )
        ),
        /* Here we configure a flexible option for the logged in user to filter orders they are assigned */
        a!recordFilterListOption(
          id: fv!index,
          name: if(
            fv!index = count(cons!VOF_ALL_ANALYSTS) + 1,
            "Me",
            fv!item
          ),
          filter: a!queryFilter(
            field: 'recordType!{c5bfe4ef-1564-4630-a19f-cbdaa1880a48}HZN_JC_JobCosting_recordtype1.fields.{0293d097-e030-4431-9bcc-f5742790bb82}assignee',
            operator: "=",
            value: fv!item
          )
        ),
      )
    )
  },
  allowMultipleSelections: true
)

  Discussion posts and replies are publicly visible

Parents Reply
  • The overall purpose of the rule is to generate a list of values that will appear in a Record List 'User Filter' - that is, a filter that a User can select (in this case) one or more values to filter the list of Records by. 

    Each item that will appear in the generated drop-down is of type 'a!recordFilterListOption', and the help for this type tells you what each attribute for that type is:

    If you put your cursor inside the opening bracket for this function then you will see the above help appear in the bottom left of the expression editor:

Children