How to click a button to jump to a personalized screen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 01:22 AM
How to click a button to jump to a personalized screen?
Instead of the default new screen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 10:42 PM
Hi @shiz ,
You can simple do like below.
top.window.location = "https://YourInstanceName.service-now.com/u_actual_times_details.do";
To get the dynamic instance url you can do below.
Client script code
var ga = new GlideAjax('HelloWorld');
ga.addParam('sysparm_name', 'helloWorld');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
Server side code: Script include
var HelloWorld = Class.create(); HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, { helloWorld:function() { var instanceURL = gs.getProperty('glide.servlet.uri'); return instanceURL; } , type: 'HelloWorld' });
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 09:38 PM
Hi @shiz ,
Please follow the below steps to open custom view when you click on new button:
1. Go List controls.
2. Click on the "New" button to edit its properties.
3. check client checkbox
4. paste following in onClick
getUiPage()
5. in script paste following code
function getUiPage(){
window.location = "$your_custom_view.do" ; //replace it with new UI Page
}
Modify according to your requirement as per view.
Thanks,
Pradeep
Regards,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 10:23 PM
I'm really sorry, but I couldn't find a specific screenshot of the "Go List controls." you mentioned? Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 10:43 PM
Can you specifically teach me how to do it? If there are screenshots, that would be great. Thank you very much!