GlideModalForm: other than current view

MichaelZischeck
Kilo Sage

I'd like to have a dialog with full form functionality (reference fields, dependant fields, everything).

GlideModalForm, I figured, is the only way to go.

but I would like to display the dialog in a different view, a stripped down version, of the actual form.

 

Is this possible? On the dialog I did not find anything.

What I could imagine though: is finding the current form on the list, setting my desired form, do my stuff, set the form on the list back to what it was before

1 ACCEPTED SOLUTION

John Dewhurst
Kilo Guru

You can use the addParm method to set the view using the sysparm_view parameter

var gp = new GlideModalForm("TITLE", "TABLE", callbackFunction);
gp.addParm('sysparm_view', "VIEWNAME");
gp.render();

View solution in original post

9 REPLIES 9

I checked here: https://servicenowguru.com/system-ui/glidedialogwindow-quickforms/

 

he uses exactly your approach, so I changed from GlideModalForm to GlideDialogForm.

Same result, view is not being changed.

but I found the solution here:

https://www.servicenow.com/community/developer-forum/glidedialogform-set-view-not-working-for-users-...

 

   d.addParm("sysparm_view_forced"true); does the trick... so you helped me really getting on the right path!

Ankur Bawiskar
Tera Patron
Tera Patron

@MichaelZischeck 

what's the actual business requirement?

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

update multiple records, but, by only providing a view with certain fields, prevent every field to be updated on selected records. I want to be able to restrict, via the used "view", which fields can be updated on selected records

@MichaelZischeck 

why not use the update selected capability which is available OOB on the table list?

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

as I said: We only want to allow "normal" users certain fields to be updated, not all of them.

But those we do should have full form functionality.

 

I solved it, see above!