Redirecting to another widget from Portal Widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2022 11:57 PM - edited ‎11-27-2022 11:58 PM
Hello All,
I have a Portal Widget which has to redirect to another widget.
Right now I use the below code:
var url = "https://dev112799.service-now.com/sp/?id=demo_widget_for_manage_acc&ci="+ci+"&env="+env;
I have hard-coded the URL, how to use the property instead to dynamically fetch and redirect from the URI?
Full code below
var url = "https://dev112799.service-now.com/sp/?id=demo_widget_for_manage_acc&ci="+ci+"&env="+env;
//var url = gs.getProperty('glide.servlet.uri') +"sp/?id=demo_widget_for_manage_acc&ci="+ci+"&env="+env;
c.data.tempname = c.fname;
$rootScope.customEvent=ci;
top.window.location =url;
TIA,
D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 10:36 PM
Hi D,
Try the below way:
In Server Code:
data.instance_url = gs.getProperty('glide.servlet.uri');
In HTML Template:
<a target="_blank" href="{{c.data.instance_url}}$sp.do?id=demo_widget_for_manage_acc&ci="+ci+"&env="+env>
OR
Directly call you other widget as below:
In Server Side:
data.xyz_widget = $sp.getWidget("<Name of your widget>");
In HTML Template:
<div class="col-xs-12 col-md-10 top-pad"
<sp-widget widget="c.data.xyz_widget"></sp-widget>
</div>
Let me know if this works!
Regards,
Arpitha G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 02:30 AM
How to do from client side as I have it in my existing script because I have to change the other HTML and Server side script which may disrupt other codes