- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 04:01 PM - edited 09-06-2024 10:35 AM
We have a Workspace template (CSM) which is read only in UI Builder, and i created a Button on the list view, which performs some changes to selected record.
BG of the button logic:
I achieve it by creating Action Assignment (Implemented as a Client script), added this action to List of Action of UX Actions Configuration, and utilized g_list.getChecked() with Ajax for record update (client scripting).
So we have functioning button, we just need to add success/info/error message to show results of this action.
g_form[method] is not available in this environment, gs[method] from Ajax not affecting UX/UI of Workspaces, g_list seems to not have this message functionality, and template is read only (cant add/edit in UI Builder)
Solution with modal or alert popup is not desirable.
The OOB Edit button in work space has this functionality, it shows success message after updating records, but i couldn't figure out where is the scripting of this button to copy solution from.
Any thoughts ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2024 12:01 PM
Ok i belive i found a solution for you 🙂 Spent quite a few hours looking at this, kinda annoyed me that it was not possible, but this workaround should hopefully be enough.
What i did was create a script include called ListMessageHandler which can then call gs.addInfoMessage and then upon returning to the client script, refresh the related list, this will cause the message to appear.
Script Include:
Client Script:
Result:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2024 06:13 PM - edited 09-08-2024 09:49 PM
Thats very interesting, because i remember i tried and it didnt show in Workspace (it did show in logs instead, i guess i did messed up somewhere else).
in a mid time i was trying to figure out how to dispatch event for <now-alert> from client script
(https://developer.servicenow.com/dev.do#!/reference/next-experience/sandiego/now-components/now-aler...)
But your solution works in my case, Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 04:56 AM
What is the Client script here, I didn't see the client script page like above screen shot.
Generally when I open open Client script, we can some field types and field name and Etc.,
Can you help me on this.
My Requirement is : In the List view when the status field is changes to Close with Action field is empty then we show the Error message.
In the related list I got, but in list view not.