Need to call widget from another widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 12:08 AM
Hi,
I am trying to get the widget from another widget. I have tried using the below code, but it is getting as empty only. "sc-variable-summarizer" this is OOB so i dont want to disturb this code.
HTML:
<div>
<div>
<sp-widget widget="data.details_widget"></sp-widget>
</div>
</div>
Server script:
data.details_widget = $sp.getWidget("sc-variable-summarizer", {
sysId: taskGr.sys_id,
tableName: getTaskRecord()
});
I can see that widget is getting called but the variables are not coming for the current record. I called the widget widget is in green color.
Please help me on this. Thanks in Advance.
Thanks and Regards,
Allu Gopal.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 12:18 AM
Hi
The most easy example is the form widget, where the server script calls the $sp.getWidget to pull the conversation widget and then use it in HTML to place the widget inside the form widget for ex <sp-widget widget="fm.widgetInstance"/>
Refer to this video :https://www.youtube.com/watch?v=VtSinbDRdcw
Also, Check below for solutions to embed widget :Embedded widgets
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 12:59 AM
Hi Sandeep,
Thanks for the reply but i have tried the similar way of passing the variables to that variable summerizer widget.
data.details_widget = $sp.getWidget("sc-variable-summarizer", {
sysId: taskGr.sys_id,
tableName: getTaskRecord()
});
But the data is not getting.
Regards,
Allu Gopal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 03:33 AM
How to pass these two variable data into the another widget.
widget 1:
data.details_widget = $sp.getWidget("hrc_variable_summarizer", {tabname: getTaskRecord(),
sys_id: taskGr.sys_id});
gs.addInfoMessage(getTaskRecord());
gs.addInfoMessage(taskGr.sys_id);
widget 2:
var tabname;
var sys_id;
//var tabname= "sn_hr_core_sbs_service_request";
gs.addInfoMessage(tabname);
//var sys_id = "15d768ea1b8911d4d849206e3b4bcbdd";
gs.addInfoMessage(sys_id);
var record = sn_std_tkt_api.TicketConfig.getTicketRecord(tabname, sys_id);
Please help me on this.
Thanks and Regards,
Allu Gopal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 06:42 AM
Hi Sandeep,
Any findings or solution for this ?
Thanks and Regards,
Allu Gopal.