Comments on: Customizing the dirty form alert popup https://servicenowguru.com/system-ui/custom-dirty-form-message/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 20:09:56 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Mark Stanger https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9087 Thu, 22 Jan 2015 20:07:02 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9087 In reply to Ben Greer.

Hey Ben, thanks for the feedback. I understand what you’re saying, but in my testing the complete override/replacement is necessary so that you get the proper dialog message. Otherwise, the standard dialog still appears. I may be missing something so if you can get it to work in the way you describe I’d be happy to add it. I agree it’s the better way if it will work.

]]>
By: Ben Greer https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9086 Thu, 22 Jan 2015 18:24:42 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9086 One problem with your script is that it will completely replace any other onbeforeunload handler

It’s better to just subscribe to the event with:

if(window.addEventListener)
window.addEventListener(‘beforeunload’, myfunc, false);
else if(window.attachEvent)
window.attachEvent(‘onbeforeunload’, myfunc);

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9085 Wed, 10 Jul 2013 18:05:47 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9085 In reply to A.

Your management needs to understand that they’re playing with fire being that far behind the curve on ServiceNow upgrades. I’m surprised you haven’t been forced to upgrade yet. The message comes from the underlying code (which you don’t have access to). It points to the message record, but if the message record doesn’t exist, it supplies the default. You can compare to the message record in the demo instance to make sure you’ve got the correct one.

]]>
By: A https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9084 Wed, 10 Jul 2013 17:57:56 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9084 Thanks a lot Mark, I already talked about upgrading but unfortunately management does not feel is necessary. If the key does not exist where
does it the message getting the text from, and how do I know what is the correct key value.

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9083 Wed, 10 Jul 2013 17:47:55 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9083 In reply to A.

You can just create that message record. As long as it has the correct ‘Key’ value, the message will show up however you want. You can access the ServiceNow demo environments at demo.service-now.com. By the way, if you’re on that old of a build, you’re in serious need of an upgrade. That should probably be your first priority.

]]>
By: A https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9082 Wed, 10 Jul 2013 17:35:39 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9082 It is Active under sys_properties.list, but when I went to look for the default message in “System UI” “Message” nothing like the stuff you show here appears. Maybe by Build tag: glide-june2011-05-25-2011__patch3-11-14-2011 has something to do with it, unfortunately no other sides
talk about glide.ui.dirty_form_support and there is not support for window.onbeforeunload in service-now site.
Can you at least send me the link to get to the service-now test site
Thanks……

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9081 Wed, 10 Jul 2013 16:11:04 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9081 In reply to A.

I just tested this on the ServiceNow demo site and it all works correctly there. I’m guessing that you don’t have the dirty form property turned on. Navigate to your ‘sys_properties’ table and make sure that the ‘glide.ui.dirty_form_support’ property exists and that it is set to a value of ‘true’.

]]>
By: A https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9080 Wed, 10 Jul 2013 15:11:34 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9080 Build date: 11-22-2011_1328
Build tag: glide-june2011-05-25-2011__patch3-11-14-2011
Can find anything describe in the images above, and I am wondering where the default message is stored and if there is any client script/business rule that is overriding it.
When I tried to code the client script nothing happens, i get no warning message at all, also when I when to look for some info in the service-now wiki website about ‘glide.ui.dirty_form_support’ the page was removed.
Any suggestions will be much appreciated.
Thanks

]]>
By: Raj https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9079 Tue, 30 Apr 2013 07:16:25 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9079 Hi Mark,

There is one problem with this dirty form alert message………

after getting alert messages/error messages from client script or business rules if we try to navigate away from user form this dirty form popup is not working….for eg:
1.user is filling incident form and had forgot to fill one mandatory field.
2.when he clicks the submit button an alert box will come saying that field is mandatory .
3.now if he tries to navigate away from the form ,it is allowing the user…. ..No dirty form popup alert is coming ….No alert message to the user saying “data has been modified and are you sure you want to leave this page..?”

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/custom-dirty-form-message/#comment-9078 Fri, 11 Jan 2013 12:41:33 +0000 https://servicenowguru.wpengine.com/?p=4192#comment-9078 In reply to Alain Müller.

Thanks for sharing this! I think eventually I’d like to come up with a solution where you didn’t have to target each specific variable individually. This approach works for an individual catalog item fine, but it’s not something that’s practical to deploy across the entire catalog.

]]>