- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2023 12:22 AM
Hello,
I want to create a button in Service Portal (ESC) on 1 of the widget and when someone click on that button user should be redirected to new page in new tab but in same browser window. Can someone please help me on this requirement.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2023 02:14 AM - edited ‎03-19-2023 02:16 AM
Hello @User734543 ,
For this u need to write this code in HTML of ur widget:
<button ng-click='c.openModal()'> Open Window </button>
And this code in "client script" of ur widget:
api.controller=function() {
/* widget controller */
var c = this;
c.openModal = function(){
window.open("https://www.servicenow.com/community/"); //add link of ur page
}
}
If u want to design ur button then u can add CSS too.
@User734543 , Please mark my answer as accepted solution and helpful. If it is works for u.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2023 02:14 AM - edited ‎03-19-2023 02:16 AM
Hello @User734543 ,
For this u need to write this code in HTML of ur widget:
<button ng-click='c.openModal()'> Open Window </button>
And this code in "client script" of ur widget:
api.controller=function() {
/* widget controller */
var c = this;
c.openModal = function(){
window.open("https://www.servicenow.com/community/"); //add link of ur page
}
}
If u want to design ur button then u can add CSS too.
@User734543 , Please mark my answer as accepted solution and helpful. If it is works for u.
Thank you.