Button to open specific view
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 05:06 AM
Hello.
I have a button i want to open the view "registrering_av_hardware_ved_innkjøp" with. How do you script buttons in forms take you to a specific view?
nyHW();
function nyHW()
{
//make the url to a new normal change
var url = sysparm_view="registrering_av_hardware_ved_innkjøp" ;
//Redirecting the user to the new url
action.setRedirectURL(url);
}
Labels:
- Labels:
-
Service Portal
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 08:49 AM
Hi asd
Try this:
function nyHW() { //create the new Requested Item Record
var newReq = new GlideRecord("sc_req_item");
var id = newReq.insert();
action.setRedirectURL('/sc_req_item?sys_id=' + id + '&sysparm_view=registrering_av_hardware_ved_innkjøp');
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2022 08:52 AM
Hi asd
can you keep logs and verify 'id' value?