How to Display info meaasge in List view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2024 05:08 AM
Hi all
I have a Module that displays the list of Group Records (sys_user_group) if the logged in User is a Manager or secondary manager of the group.
Now the ask is to display an info message if no records are displayed in the list view.
How can i do this?
Thanks in advance !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2024 05:18 AM
Hi @Madhan007 ,
Create a query business rule:
if(current.getRowCount() === 0)
gs.addInfoMessage('No records found.');
If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.
Thanks,
Amitoj Wadhera
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2024 05:49 AM
Hi @Amitoj Wadhera ,
It showing the info message even when opened for a new Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2024 06:37 AM
Hi @Madhan007 ,
Please update your script to:
(function executeRule(current, previous /*null when async*/ ) {
var uri = gs.action.getGlideURI().toString();
if (current.getRowCount() === 0 && uri.indexOf('list.do') > -1) {
gs.addInfoMessage("Your message here");
}
})(current, previous);
If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.
Thanks,
Amitoj Wadhera