- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 03:16 AM
For a table I have to configure a form link "Show closed activities". This link should only be visible for users with role "emp_admin". When link pressed, the system should open a new tab with list of all closed records that apply to the same Employee.
When I click on the link, nothing is happening. What am I doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 03:42 AM
gs object is server side and your UI action is client side.
So it's not working.
do this
I hope your state field name and choice value for Closed is correct. if yes then this will work
function showClosedActivites(){
var url = '/u_manager_activites_sv_list.do?sysparm_query=u_employee=' + g_form.getValue('u_employee') + '^state=Closed';
g_navigation.open(url, '_blank');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-23-2023 05:55 AM
are you sure the field name is state and not u_state since it's a custom table?
what's the error in browser console? what happens when user clicks on it?
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-23-2023 06:02 AM
The field name is state as it is extended from task table.
The browser error I get is as follows:
When the user clicks on the link, nothing happens.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 08:59 AM
in script your function name is wrong
it should be this
showClosedActivities and not showClosedActivites
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader