- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2018 04:00 AM
I need to omit the NEW button from a List based on the view.
In one view I want the NEW button to display, in the other I do not.
in a Client Script you can use getView(); that does not work in this condition script.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2018 04:32 AM
Hi,
you can use the approach of ACL;
open create ACL and in script section have this
answer = determineVisible();
function determineVisible(){
var viewName = '';
var map = gs.action.getGlideURI().getMap();
if (map.get('sysparm_view') != null) {
viewName= map.get('sysparm_view').toString();
if(viewName == 'self_service')
return true; // show new button
else if(viewName == 'xyz')
return false; // hide new button
}
}
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎03-25-2021 01:53 AM
Can you post a new question for this and tag me
as this is very old post it becomes difficult to track
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2018 05:17 AM
this works well.
you UNCHECK the Omit New Button checkbox
and
then add your script.
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2018 05:33 AM
Hi,
Can you mark answer as correct and helpful.
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
‎11-26-2018 06:04 AM
Hi,
Can you mark my answer as correct and helpful.
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
‎11-29-2018 11:20 PM
Hi,
Can you mark my answer as correct and helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader