Navigation Handler doesn't change view

Chris M3
Tera Guru

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.

2 REPLIES 2

Chris M3
Tera Guru

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();


martinb
Giga Contributor

Have you tried setting the sysparm_view = 'default'