Info Message in Workspace using UI Action

srujancherr
Tera Contributor

I have created a UI Action on the Risk Assessment Instance table. When I click the button from the Risk Workspace, I am unable to display any information messages that I add in the UI Action.

The Risk Assessment page is opened as a subpage within the Risk Workspace, for example:

/now/risk/risk/record/sn_risk_risk/aa9d674d83a64310fba8c4e0deaad379/sub/risk-assessment-homepage/80c35c1583628310fba8c4e0deaad3ee

Since the Risk Assessment page is rendered as a subpage of the Risk record, the standard information messages are not displayed after the UI Action executes.

My requirement is to continue using a UI Action to implement this functionality. I would like to display a success or informational message at the top of the Workspace after the button is clicked. I cannot use a modal dialog, as the requirement is to show a banner/toast-style message at the top of the screen.

So far, I have tried the following approaches without success:

  • gs.addInfoMessage()
  • alert()
  • getMessage()

Could you please suggest the recommended approach for displaying an information or success message in this Workspace scenario after executing a UI Action?

Thank you.

2 REPLIES 2

Its_Azar
Mega Sage

Hi there @srujancherr 

 

You can't rely on gs.addInfoMessage() in Workspace, it's intended for the classic UI and won't display reliably on Workspace subpages like the Risk Assessment page.

If you're using a Workspace UI Action, make it Client = true and use g_form.addInfoMessage() after the server action completes. alert should ideallly work, show the code snippet if this doesn't work.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Architect@ KPMG.

Hi @Its_Azar ,

 

Thanks for your response,

In workspace direct page we are able to see the info messages but if you see the URL I pasted its a sub page there I cannot see the Info messages even after trying g_form.addInfoMessage()