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');
}
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
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?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP