spModal - How to pass values from spModal to original widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 03:31 PM
Hi Everyone,
I am using spModal in page to open a new record in a table (opening form widget in spModal), i have passed sys_id,table name and view in parameters(WidgetInput), how can i get output of that form after creation say sys_id??? and how to close the modal after selecting save or submit in embedded widget
spModal.open({
title: label,
widget:'widget-form', //FORm WIDGET
buttons: [{label:'${Close}', cancel: true}],
size:"md",
widgetInput: {sys_id : -1,table : TABLE_NAME,view : 'new_record',disableUIActions : false}
}).then(function(){
console.log('widget dismissed');
})
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 10:38 PM
Please see solution below
https://community.servicenow.com/community?id=community_question&sys_id=ec57bb31db5f67409a64e15b8a961989
Regards,
sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 01:10 AM
Hello Sachin,
I want the sys_id of new record from the embedded widget, the above community link gives me about how to pass inputs to embedded widget which i already k ow
Regards
Saran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 08:27 AM
Hi
Were you able to get this done ? I am also stuck trying to do same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 02:44 AM
Hi
You can close it by using $scope.$parent.$parent.$dismiss(); in your client script on click of those buttons.