pickerFieldUsers - remove loggedin user

Hi Team,

I have group - Group1

In the group 1, we have 3 users

user1, user2, and user3.

Now, I have loggedin with user1 account. In the pickerField now the user1 should not be listed out.

Can you please help with the approach. 

a!pickerFieldUsers(
                    label: "Users",
                    labelPosition: "JUSTIFIED",
                    maxSelections: 5,
                    groupFilter: cons!Group1,
                    value: local!selectedApprovers,
                    saveInto: local!selectedApprovers,
                    required: true(),
                    validations: {}
                  )

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    The best thing you can do here is to add a validation that displays a validation message when the current user is selected.  The second best thing to do (which would be slightly more automatic but could potentially introduce some confusion) would be to intercept the current user from even being saved by using a more advanced line of code in your saveInto parameter.  But honestly, I'd just go with the validation method.

Reply
  • +1
    Certified Lead Developer

    The best thing you can do here is to add a validation that displays a validation message when the current user is selected.  The second best thing to do (which would be slightly more automatic but could potentially introduce some confusion) would be to intercept the current user from even being saved by using a more advanced line of code in your saveInto parameter.  But honestly, I'd just go with the validation method.

Children
No Data