Skip to main content
Known Participant
Mar 4, 2024 9:51 AM UTC
Question

Check if the loggedinuser is part of the recordtype?

I have a recordtype "User" and it has column named : 'IsInternal' that decides if user is internal or external and its a Boolean field. On the basis of this column i want to find out if the loggedinuser is external or internal how can I achieve that? after knowing that if the user is internal or external i will enable and disable the filter list options which i am achieving through logic below:

a!recordFilterList(
  name: "User Email Domain",
  options: {
    a!recordFilterListOption(
      id: 1,
      name: "Internal",
      filter: a!queryFilter(
        field: User.isInternal,
        operator: "=",
        value: true()
      )
    ),
    a!recordFilterListOption(
      id: 2,
      name: "External",
      filter: a!queryFilter(
        field: User.isInternal,
        operator: "=",
        value: false()
      ),
      
    )
  },
  defaultOption: "External",
  isVisible: true,
  allowMultipleSelections: true
)

3 replies

harshm4411
Participating Frequently
Mar 4, 2024 10:26 AM UTC

Hey,

Based on my interpretation, it seems you want to display the filter list options based on whether the loggedInuser is internal or external. To achieve this, you can query the user record using a filter that considers the loggedInuser, retrieving details such as the user's internal status (as a boolean value). Then, utilize the isVisible parameter in recordFilterList to incorporate the obtained response (true or false) for appropriate visibility settings.

Known Participant
Mar 4, 2024 10:29 AM UTC

Yes how can I filter the loggedinuser from recordtype?

harshm4411
Participating Frequently
Mar 4, 2024 10:39 AM UTC

You need to create a query record rule for the user record type, add filter based on the field where usernames are stored and get the details of that user.