How to open pop up form with some field

shweta14
Tera Contributor

I have a requirement on incident to open pop up form

on that pop up form it should have few fields from another table.

which will submit record with some details from incident and popup on the other table form.

can we do it with Business rule not from ui action.

 

 

1 ACCEPTED SOLUTION

Are you saying you want the actual field to display and not just the value? If so I would recommend doing a GlideDialogForm with a custom view that only shows the fields you want it to show. Here is an example of one I did:

 

 

    var tableName = 'TABLE NAME HERE';
    var sysID = g_form.getUniqueValue(); // sys_id of the record you want to show

    var dialog = new GlideDialogForm('TEXT HERE', tableName);
    dialog.setSysID(sysID); //Pass in sys_id to edit existing record, 
    dialog.addParm('sysparm_view', 'VIEW NAME HERE'); //Specify a form view
	dialog.setDialogHeight(600);
    dialog.render();

 

View solution in original post

7 REPLIES 7

Mark Endsley
Tera Guru

You could use a modal in the platform view or Service Portal view.

 

Here is the code you'd need to write for the platform view. This would be done in a client script.

 

 

var gm = new GlideModal();
gm.setTitle('Whatever you want');
gm.renderWithContent('Put fields here');

 

Thanks for the reply Mark !

 

I used below code it is opening pop up but the whole form i want to open it with few fields.

 

function onSubmit() {
if(g_scratchpad.action ){
return true;
}
var gModalForm = new GlideModalForm('Create xyz', 'xyztablename');
gModalForm.setPreference('description', g_form.getValue('description'));
gModalForm.render();

return false;
}

Are you saying you want the actual field to display and not just the value? If so I would recommend doing a GlideDialogForm with a custom view that only shows the fields you want it to show. Here is an example of one I did:

 

 

    var tableName = 'TABLE NAME HERE';
    var sysID = g_form.getUniqueValue(); // sys_id of the record you want to show

    var dialog = new GlideDialogForm('TEXT HERE', tableName);
    dialog.setSysID(sysID); //Pass in sys_id to edit existing record, 
    dialog.addParm('sysparm_view', 'VIEW NAME HERE'); //Specify a form view
	dialog.setDialogHeight(600);
    dialog.render();

 

added the code but opening like this

 

shweta14_1-1666110489786.png