Skip to main content
Known Participant
Apr 5, 2024 1:36 PM UTC
Question

Error while deleting multiple user from grid

4 replies

stefanhelzle0001
Brainy
Apr 5, 2024 1:55 PM UTC

Sure, the code in line 41 does not work. You need to call a!removeGroupMembers inside the saveInto.

Known Participant
Apr 6, 2024 7:16 AM UTC

Thanks Stefan!!

mikes0011
Brainy
Apr 5, 2024 2:55 PM UTC

It feels like you're using some of these components without fully understanding what they actually do.  I understand it's part of the learning process, though generally I'd recommend starting simpler and building up from there, making sure you understand what the code is doing before stepping up to the next level of complexity.

In the case of your "remove users" button though, per what Stefan mentioned, you have a simple mix-up.  For an action button like this, the "value" parameter is arbitrary and often not needed at all (like in your case).  The "remove group members" function, as is mentioned in the documentation, needs to go *directly in the SaveInto*.

  a!buttonWidget(
    label: "Remove Member",
    /* value: a!removeGroupMembers(
      members:ri!removeFromGroup
    ), */
    saveInto: {
      /* ri!btnAction, */  /*probably not needed */
      /* a!save(ri!userToRemove, local!selectionValue), */  /* also probably not needed */
      a!removeGroupMembers(
        group: ri!initialGroup,
        members: local!selectionValue
      )
    }
  )

The Expression Guru
Known Participant
Apr 6, 2024 7:22 AM UTC

I understood mike. I will start simpler and understand it.

Taking it as part of learning.

Thanks for the solution and guidance.