Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

gs.addInfoMessage is not working on Declarative List Action in workspace view.

Ganeshm1
Tera Guru

Hello All, 

I have created a simple List Action for the Hardware Asset workspace to update asset records on list view. 
Update is working as expected but info message is not appearing upon update. Any idea on this? 

Ganeshm1_0-1788445704285.png

 

 Code: 

current.gl_account = 'test';
current.update();
gs.addInfoMessage('update successful');

Thanks in advance. 

Ganesh

1 REPLY 1

Nishant8
Tera Sage

Hello @Ganeshm1 , you can enable it as follows:

- Open the Asset Workspace and expand the Body->Main->Container1->Main->Tabs 1

- On the right side, under the Configure, expand the Hardware assets Viewport, open Hardware assets default

- Since this page is read-only, create duplicate variant of it (configure the order -1 as OOB has order 0)

- In the duplicate variant, open the Body->Row One-> List1; open the Events on the right side

- Click on Add event mapping, search for Notification(s) displayed event and add it

- Now, ensure that you bind the data as @payload.notifications

 

I have attached all the screenshots in the attached doc for your reference. It will display the notification once enabled properly.

 

Regards,

Nishant