- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 08:47 AM
I'm not sure what to search on to find this, so I'm asking here.
Here's the scenario:
- I have a form with some mandatory fields
- Another form via server script creates a new record for the above stated form with some values populated, but there are still mandatory fields that are not populated, and then navigates to that form
- ServiceNow shows the fields as mandatory, however the user can leave the record without changing anything and the system won't prompt the user indicating the record is incomplete.
I realize what's happening is ServiceNow believes the record is unchanged, so the edits aren't kicking in that tell the user something changed and you need to save it, but you can't save it because there are mandatory fields that are not filled in.
I thought I'd be able to use a client script on the form load to populate a field, hoping it'd appear as if the user entered something, then starting the "website wants you to stay here because it's unsaved" process. However it doesn't seem to work that way. The value being set via the client script gets saved, and the mandatory fields stay empty with no prompt to the user indicating they are required.
Any thoughts on how to trigger the "website wants you to stay" logic?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 02:14 PM
You could set the Dirty Form flag. Try this in an onload Client Script:
function onLoad() {
// Reset dirty form flag.
g_form.modified = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 09:22 AM
Hi Charles,
Can you check that any of your client scripts have some thing like this
g_form.checkMandatory=false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 09:26 AM
Hello, if I key in one of the fields manually, the "website wants to stay" prompt comes up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2015 02:14 PM
You could set the Dirty Form flag. Try this in an onload Client Script:
function onLoad() {
// Reset dirty form flag.
g_form.modified = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2015 07:13 AM
That did it, thank you!