Setting a UI View using a UI Action

scottangehr
Giga Guru

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

1 ACCEPTED SOLUTION

scottangehr
Giga Guru

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

View solution in original post

17 REPLIES 17

Chuck Tomasi
Tera Patron

Are you absolutely sure that Account_Request is the name of the view? To be sure, go to the table sys_ui_view.

find_real_file.png

 

Then look for the TITLE that matches your view name. This is the display value. The sysparm_view arg requires the name. In this example, the title is "Self Service", but the name is "ess". Use the name on the URL, not the title.

find_real_file.png

I'm absolutely sure  🙂

I just adjusted it to lower case

scottangehr
Giga Guru

I'm absolutely sure 🙂

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

How are you redirecting it?

Is it from client side or server side ui action?

Also is there any view rule for that table? check this

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader