How to display popup dialog modal on change of value in drop down field ?

Ujala
Kilo Contributor

Hi All,

I wanna display a popup modal with reference field ,on change of value in choice field. When I select 'A' or 'C' option from choice drop down. I wanna display a popup dialog modal with reference field to location table. 

Thanks in advance

8 REPLIES 8

Ash10Patil
Kilo Guru

Hi,

 

You can create onchange client script for choice field <X> and use below script to open popup.

var dialog = new GlideDialogWindow(<ui_page>); //Render the dialog containing the UI Page 'terms_and_conditions_dialog'
dialog.setTitle(<title>); //Set the dialog title
dialog.setSize(600,600); //Set the dialog size
dialog.removeCloseDecoration(); //Remove the dialog close icon
dialog.setPreference(<option_name>,<option_value>); //Set optional parameters which can be accessed in UI page
dialog.render();

 

Create UI page and add reference field location to it and add logic(if any) in UI page client script.

 

Thanks. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ujala,

Can you explain from the process point of view what purpose it holds of showing the reference field on selection of that choice values?

You can definitely achieve it by calling GlideDialogWindow and the UI page which you will create.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ujala
Kilo Contributor

Hi Ankur,

Whenever CI install status field changes to Pending Disposal or In Stock the pop -up needs to show ,to which stockroom it has to add into.

If the stockroom selected in the above step is different from last known stockroom location on Asset.Asset stockroom should be changed to that selected.

@Ujala

So once they change the status you want to show UI page with the option to allow user to select the stockroom from stockroom table.

Once they select the stockroom from UI page the new stockroom would be updated on the form?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader