How to set standard view in a Demand form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:57 AM
Hi, I'm learning the ServiceNow platform, specifically SPM. I'm currently working on a case study that I received from my company. Every day I'm struggling with problems, it's frustrating. This tells me that I still have a lot to learn.
For example: I'm searching for a solution to keep the "Default view" on a form, I would think nothing would be easier than that., but I have been looking for a solution for hours and cannot find one.
- I'm on a Demand form (as Admin/or another user)
- I'm seeing the form in "Default view"
- filling out some fields in the Demand form
- After clicking on the button "Submit demand"
The form updates the status to "Submitted" and then reloads to the "Self Service" view. But I want to stay in the "Default view". I have found a lot of suggested solutions, such as
- adding the role to "servicenow glide.ui.personalise_form.role"
- change the "UI view"
- change the "link type" in the request module
- reading SN docs
None of the suggested solutions I found solve my problem. Do you know, how I can set the Standard view of a form for specific users or as well for an Admin role?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 06:08 AM
I understand your frustration, and I'm here to help. To keep the "Default view" on a form after submitting the demand, you can use a client script. Follow the steps below to create a client script that sets the form to the "Default view" after submitting the demand:
- Navigate to System Definition > Client Scripts in ServiceNow.
- Click "New" to create a new client script.
- Set the following values for the new client script:
- Name: Set Default View on Demand Form
- Table: dmnd_demand
- Type: OnLoad
- Script:
function onLoad() {
// Set the form to the Default view
g_form.setView(''); // Pass an empty string to set the view to Default
} - Click "Submit" to save the new client script.
-
Now, when you submit a demand, the form should stay in the "Default view" instead of switching to the "Self Service" view. This client script forces the form to load in the "Default view" every time the form is loaded.
If you still face issues, make sure that the "Default view" is set as the default view for the Demand form:
- Navigate to System UI > Views in ServiceNow.
- Search for the "Default view" record associated with the "dmnd_demand" table.
- Open the record and ensure that the "Default" checkbox is checked.
- Click "Update" to save any changes.
Please try this solution and see if it solves your problem. If you still have issues or need further assistance, feel free to ask.
---------------
Regards,
Rajesh Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 06:33 AM
Hi Rajesh, thank you for your reply and understanding. I have found my mistake. A few days ago I have add an UI Action with a new button and in the script of the UI Action I have the method (do you call method for this?)
'g_form.submit()'.
This method always load the list of all demands instead keeping me on the form of the demand.
So I replaced it with 'g_form.save()' and now it works. So when I'm on a form and click on the button I've created, I'm not redirected to the list of all demands, I remain on the form. Yeah!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 08:11 AM
Please do mark my response as correct or helpful, if applicable, this will help others referring correct answers
---------------
Regards,
Rajesh Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 04:31 AM
Yes, for sure, your response is helpful, so I have marked as helpful.