- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 06:01 AM
Good day team
I'm having a conundrum with setting a view using a UI Action. It worked previously and doesn't seem to want to now. I have used the following to set the view when a UI Action is clicked:
var link ="sc_request.do?sys_id="+sysID+"&sysparm_view=Account_Request";
When that didn't work, I searched the community and attempted to use this:
task.set('sysparm_view', 'Account_Request');
task.set('sysparm_view_forced','true');
Any help is appreciated.
Regards,
Scott
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2019 05:33 AM
Moved this up to after the tasksys.insert and it works
var link ="sc_request.do?sys_id="+task.sys_id+"&sysparm_view=account_request";
action.setRedirectURL(link);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 06:37 AM
Its client side
Here is my code
var task = new GlideRecord("sc_request");
//removed all other code
var link ="sc_request.do?sys_id="+sysID+"&sysparm_view=Account_Request"+"sysparm_view_forced=true&sysparm_userpref_module=false";
gs.addInfoMessage(gs.getMessage("Request {0} created", task.number));
action.setRedirectURL(task);
action.setReturnURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 06:51 AM
Hi,
in client side code you cannot use action object
you can use below
what is the sysID variable storing and how value is stored in it?
var link ="/sc_request.do?sys_id=" + sysID + "&sysparm_view=Account_Request" + "sysparm_view_forced=true&sysparm_userpref_module=false";
window.open(link);
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
10-02-2019 08:05 AM
Then maybe its server side? I copied an OOB action.
Let me try this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 08:11 AM
No - that did not work.
When I do not have the set view in the code, the redirect works as expected.
As soon as I add to set the view, that's where the code stops
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2019 11:05 AM
Hi,
If you add sysparm_view parameter it fails?
Did you check any view rule on that table?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader