onLoad script to clear the default 0.00 from currency field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 06:24 AM
Hi,
I have a requirement to clear the default 0.00 in a currency field, preferrably when the form loads. This is my script and it's not working:
function onLoad() {
if(g_form.isNewRecord()){
g_form.setValue('currField, ' ');
// g_form.setValue('currField, ' NULL'); // not working either
}
If I put a fixed value:
g_form.setValue('currField, ' 2'); // it works
I don't get it!
I already searched the other questions like this one :
https://community.servicenow.com/community?id=community_question&sys_id=2dd8da1edbd15300fc5b7a9e0f96193b
it's not working for me.
Thanks!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 07:57 AM
Not working unfortunately. I' guess I'll leave it as is and tell the client it can't be done.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 07:59 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 08:02 AM
the message you will see on top
New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 08:12 AM
I have a little troubele following your screenshots.
yes I'm on London.
How do I get the form you're referring to?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 08:15 AM
create new property
NAme: glide.script.block.client.globals
type: true/false
value: false
then your script will work..