Hide record action immediatly after click

Certified Senior Developer

Hello there!

I have a related action on my records which are displayed in a grid.

Is it possible to hide the icon starting the action immediately after the user clicks on it?

Otherwise there are users who do multiple clicks, and since my action deletes the same record, they end up with a sad

An error occurred while applying the context for the [myRecordName] related action [identifier=12,086]. Details: The record data does not exist, has been deleted, or you do not have sufficient privileges to access it.

In fact, the record disappears from the grid quickly after the click, but not immediately, and sometimes user can click again.

The record action is a related record action, configured to be call the deletion process as follows:

{
  idRecord: rv!record[[myRecordName.id]],
  cancel: false()
}

Part of the code:

      a!gridField(
        labelPosition: "ABOVE",
        refreshInterval: 1,

data: a!recordData([...]),

columns: {
[...]

            a!gridColumn(
              label: "",
              value: a!recordActionField(
                actions: {
                  a!recordActionItem(
                    action: [myRecordName.actions.deleteTheRecord],
                    identifier: fv!row[[myRecordName.id]]
                  )
                },
                display: "ICON",
                style: "CALL_TO_ACTION"
              ),
              align: "CENTER"
            )
          },
          refreshAfter: "RECORD_ACTION",
          showSearchBox: true,
          showRefreshButton: true,
          showExportButton: true,
          actionsDisplay: "ICON",
          actionsStyle: "TOOLBAR"

)

In place of changing my users, what would be a possible solution?

  Discussion posts and replies are publicly visible