Skip to main content
April 5, 2024
Question

Error while deleting multiple user from grid

  • April 5, 2024
  • 4 replies
  • 0 views

4 replies

stefanhelzle0001
Brainy
April 5, 2024

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

April 6, 2024

Thanks Stefan!!

mikes0011
Brainy
April 5, 2024

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
April 6, 2024

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

Taking it as part of learning.

Thanks for the solution and guidance.