Navigation Handler doesn't change view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2017 08:38 AM
What I'm attempting to do is redirect the user to the default view when they navigate to the form view of a record. The idea is to create some additional custom list layouts for the list view of the table, without having an associated form view. So for example, I have a list layout called lpar, which shows a bunch of fields from a dot-walked table. When they click into the actual CI, I would like them to see the default view
Below is the code in the navigation handler
var current_view = (g_uri.get("sysparm_view") + '').toUpperCase();
gs.log('CurrentView: ' + current_view, 'ChrisLog');
if (current_view != "" || current_view != "REGISTRATION") {
g_uri.set("sysparm_view", "");
gs.log('Setting Default: ' + current_view, 'ChrisLog');
}
gs.log(g_uri.toString(), 'ChrisLog');
answer = g_uri.toString();
The logs seem to indicate it's working. It's getting the current view, realizing it's not one of the form views, and replacing sysparm_view with blank, however the form still shows the other custom view (both in the header, and I also confirmed by customizing some fields).
I also tried redirecting to the registration view to see if it was the '' that it didn't like, but that didn't work either.
There are no view rules associated with this table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2017 09:18 AM
Ignore the bad logic in the if statement.. I tried simplifying it, and always pushing to the default view to see if that worked, and still nothing. Am I misunderstanding what Navigation Handlers are supposed to accomplish?
Simple test:
g_uri.set("sysparm_view", "");
answer = g_uri.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017 07:59 AM
Have you tried setting the sysparm_view = 'default'