- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 04:14 AM
How to run a script on List View without onCellEdit. Like in a sense if we load a list view of table the script should run.
Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2022 12:28 AM
Hi,
then you can check this link where I shared solution 3 years ago
Display Info message only on list layout
The script section of query business rule will check and show info message only on list and not on form
var index = gs.action.getGlideURI().toString().indexOf('u_tableName_list'); // give the table name here
if(index == -1){
// it means it is form
}
else{
gs.addInfoMessage("click on the desired drink to know its nutritional value");
// it means it is list
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2022 11:56 PM
Hi,
I believe that's not the complete requirement.
Can you provide complete business requirement with an example?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2022 12:08 AM
There is a table which lists all the drink of a particular shop. In the list view we can only see name of the drink and image of the drink as I personalized the list view. To know the nutritional values of any particular drink user has to click on the particular record.
so now I want add an info message in the list view as "click on the desired drink to know its nutritional value". At the same time I don't want this info message to be displayed on the form view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2022 12:28 AM
Hi,
then you can check this link where I shared solution 3 years ago
Display Info message only on list layout
The script section of query business rule will check and show info message only on list and not on form
var index = gs.action.getGlideURI().toString().indexOf('u_tableName_list'); // give the table name here
if(index == -1){
// it means it is form
}
else{
gs.addInfoMessage("click on the desired drink to know its nutritional value");
// it means it is list
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader