Comments on: JavaScript Popup Boxes in ServiceNow https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 21:56:02 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: MG https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6032 Wed, 06 Jul 2016 20:57:11 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6032 Good note on the “prompt” function:

If you input a second variable, it will default text into the prompt box.

Example:
var releasename = prompt(“What is your new release called?”, “Default value”);

When the pop-up box appears, “Default value” will already be entered in there.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6031 Fri, 10 Apr 2015 14:37:38 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6031 In reply to Sonia.

This should be what you need.

https://servicenowguru.com/scripting/client-scripts-scripting/testing-valid-record/

]]>
By: Sonia https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6030 Fri, 10 Apr 2015 14:09:05 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6030 How can I run the OnSubmit client script (confirm box) above only when the record is new? (like current.operation = insert or current.isNewRecord() GlideRecord functionality)

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6029 Tue, 12 Mar 2013 02:07:11 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6029 In reply to Morgan Glines.

It’s possible by setting workflow scratchpad variables and then accessing them using a display business rule (which can pass values to the client to initiate a popup dialog). You can check out scratchpad and display business rules on the wiki. Here’s a link to get you started.
https://wiki.servicenow.com/index.php?title=Accessing_the_Workflow_Scratchpad_from_Business_Rules

]]>
By: Morgan Glines https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6028 Tue, 12 Mar 2013 01:13:27 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6028 Could you please advise if there’s a way of doing this in Workflow? I’d like to prompt the user, then store that value on the scratchpad for use with tasks that are created later on.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6027 Tue, 13 Nov 2012 13:02:56 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6027 In reply to Roderick.

There’s no way to change those on a standard javascript confirm popup. If you wanted to change the button text, you would have to use an entirely different type of dialog, using ServiceNow popups. That’s quite a bit more complex but there are examples that will get you started on SNGuru if you search for ‘GlideDialog’.

]]>
By: Roderick https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6026 Mon, 12 Nov 2012 23:48:39 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6026 Is there a way to change the text of the Confirm popup to Yes & No instead of Ok & Cancel?

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6025 Sat, 25 Feb 2012 03:40:53 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6025 In reply to Sharee.

There is in the Aspen release. You can set up an ‘onCellEdit’ client script. See the wiki for details.
http://wiki.service-now.com/index.php?title=Client_Scripts#onCellEdit.28.29_Scripts

]]>
By: Sharee https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6024 Sat, 25 Feb 2012 02:38:14 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6024 Is there a way to make an alert or prompt “pop” on change if the user is list editing? It’s working fine from within my form but lets them list edit without the popup.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/javascript-popup-boxes-servicenow/#comment-6023 Wed, 26 Oct 2011 14:51:06 +0000 https://servicenowguru.wpengine.com/?p=419#comment-6023 In reply to Andrew Smith.

Unfortunately, JavaScript limits you in this respect. You can only control the type of alert box and arrange your text into multiple lines if needed. For more flexibility you should consider a GlideDialogWindow or a g_form info message. I’ve updated this page with more information on these options.

]]>