Open a Incident Form inside a Popup on service Portal Page

NILESH THORAVE
Kilo Contributor

I have Kingston instance of ServiceNow, On Service Portal, we have a page which contain widget that provides incident form for incident creation. I want to show that page/form inside a popup which is triggered on UI Event. 

I might need to pass some prepopulated fields for that form

What is the best way to achieve this?

 

4 REPLIES 4

rahulpandey
Kilo Sage

Hi Nilesh,

You can use spModal.open to open form widget and provide the widget parameters there. 

https://docs.servicenow.com/bundle/istanbul-application-development/page/app-store/dev_portal/API_reference/SPModal/concept/SPModal-API.html

NILESH THORAVE
Kilo Contributor

Thanks Rahul

 

Is there any way to show a whole page instead of a widget in spModal??

Hi,

The widget itself renders whole page unless you are not talking about header and footer of the portal.

Akshay37
Mega Guru

Hi ,

 

You can use spModel open method functionality by calling form widget present OOB 

 

spModal.open({

title: 'Incident',
widget: 'widget-form' ,
size:'lg',
widgetInput : {table:'incident', sys_id:sysID} //pass the sys_id of a incident need to display
}).then(function () {

})

Note: Please insure you have inserted spModel in the controller function as a dependency injection.

this code you can specify in the ng-click function. After click form will be open as a popup.

 

 

Please Mark it as helpful if it helps you