How to access widget input passed from a catalog client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 10:28 PM
Hi Experts,
I have a pop up modal that displays instructions right after I submit a catalog item, I am trying to achieve this using, an OnSubmit catalog client script,
function onSubmit() {
//Type appropriate comment here, and begin script below
if (typeof spModal != 'undefined' && !g_scratchpad.checkFlag)
{
spModal.open({
title: 'Read Me',
widget: 'read_me_widget',
widgetInput: {cat_sys_id: '2f918ad6e8999add2918ad6e843', variable_name: 'nothing'}
}).then(function(confirmed)
{
if(confirmed)
{
g_scratchpad.checkFlag = true;
g_form.submit();
}
else
{
g_scratchpad.checkFlag = false;
}
});
return false;
}
}
As you can see I am trying to pass the widgetInput object which holds the cat_sys_id as well as a variable_name. In the read_me_widget, I was supposed to fetch them values in the input object but I am unable to do so. However, when I try embedding a widget using spModal on another widget client controller, the same seems to work fine.
Any help or pointers in the right direction is highly appreciated!
Thanks,
Raskill
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 01:54 AM
Hello,
I think the below link is worth checking
Plz reference it.
Mark my ANSWER as CORRECT and HELPFUL if it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 06:02 AM
Thanks creativethinker to the post. Although it speaks little of how the server side code of the target widget is able to access the widgetInput.