Running modal in workspace form

MaharshiC
Tera Contributor

Hi,

 

Is it possible to run a modal after submitting a form in custom workspace? Some Example script will help. Also is it possible to redirect user to some other page using the modal?

 

 

1 ACCEPTED SOLUTION

@MaharshiC 

why not open that in new tab so that form gets saved and the tab is also opened?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@MaharshiC 

why to show modal during submission?

You can use onSubmit client script and use g_modal

you will multiple examples in OOB UI actions in workspace client script where g_modal is used.

you can refer those and create similar in your client script

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar ,

 

Actually I tried this but its working in the form but not working on the workspace. Also will I be able to redirect the user to some other page using this modal.

var gm = new GlideModal("glide_warn", true, 600);
gm.setTitle("Upload status");
gm.setPreference("title", "Your record is uploaded");
gm.setPreference("onPromptComplete", function() {alert("Ok")});
gm.render();
    }

@MaharshiC 

GlideModal won't work in workspace client scripts

you should be using g_modal

check this link

How to use UI Actions in Workspaces 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar ,

 

Will it be possible to use it in client scripts instead of UI action? My requirement is basically after the user submits a form in the workspace then a modal should show and have a button that will redirect them to a given url