How to display a record view as a pop up from Ui Action

wakespirit
Kilo Guru

Dear all,

I have a request to display a record view as  a popup window from a UI Action.

For exemple let say that I define a new view for editing a user call myUserView.
Then from a UI Action button I wold like to display that view as a popup window with a specific size, like a dialog box.

Then I can edit my user field and pressing Save button will save my record normally.

What is the way to do this ?

sample are welcome

regards

1 ACCEPTED SOLUTION

Mostly it is  gs.action.getGlideURI();uri.get('sysparm_view') != 'YOUR VIEW NAME'; which is evaluated, this reads th4e url and takes the parameter(view) to build the condition.

The link below will tell you how to prefill the form with some values if you want to.

https://docs.servicenow.com/bundle/helsinki-platform-user-interface/page/use/navigation/concept/c_NavigatingByURL.html

Please mark my answer correct/helpful if it helped you solve your issue.
-Anurag

-Anurag

View solution in original post

7 REPLIES 7

Anurag Tripathi
Mega Patron
Mega Patron

You can create a ui page and add an iframe in it, in the iframe you can open your record in the view you want.

 

and from the ui actiuon you can render this ui page using GlideModal() or GlideDialogWindow()

-Anurag

I manage to do it using the following :

function showUserNewForm(){
	//Get the table name and sys_id of the record
       var tableName = 'x_58872_needit_cascadesequence';
       var sysID = -1;

       //Create and open the dialog form
       var dialog = new GlideDialogForm('Create User Member', tableName); //Provide dialog title and table name
       dialog.setSysID(sysID); //Pass in sys_id to edit existing record, -1 to create new record
       dialog.addParm('sysparm_view', 'PopUpUser'); //Specify a form view
       dialog.addParm('sysparm_form_only', 'false'); //Add or remove related lists
       dialog.render(); //Open the dialog
}

When I click my UI Action button on my form, it display my customer view called PopUpUser.

That works nicely.

Only thing I have is that when the popup form gets displayed, it shows my Ui Button again at the buttom, how to disable the UIAction button from my form when it has open ?

You can Disable Show Insert field on custom Button to hide during creation

thanks,

is tehre a way to prefilled a particulqr field when my popup is open ?

regarsd