- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 03:42 AM
Hi Everyone,
Hope everything is going good.
I have two icon link widgets, "create new incident" and "Create new Custom table record" and each redirects to different pages in service now instance. For example, Widget A directs to Create new Incident record page and Widget redirects to Create new Custom table record page. Now, I want to make these widgets visible to all the users irrespective of their role, but if user doesn't have role on custom table, then when he clicks on "create new custom table record" widget, then he needs to redirect to the catalog item in service portal.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 07:11 AM
Hello,
You have to clone and customize Icon Link to have this functionality,
In server script, add these lines
if(gs.hasRole("<role name>"))
{
var gr = $sp.getInstanceRecord();
data.href = $sp.getMenuHREF(gr);
}
else
{
data.href = "?id=sc_cat_item&sys_id=<sys-id of catalog item>";
}
Fill <role name> & <sys-id> as per your requirement.
Please mark helpful if it solves the purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 10:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 10:36 AM
For which selection?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 10:38 AM
Sorry, selection means?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 10:39 AM
For catalog form or the custom table form, which part is throwing error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2020 10:41 AM
for custom table it is throwing the error, usually if user doesn't have access to the table, it throws the same error in general. Even before writing this server script, if i logged in with user who doesn't have access to student table, if he clicks on create new, it has shown the same error.