- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 02:21 AM
Hello... I'm a newbie on servicenow. I want to ask how to convert currency, glide date and decimal to float so i can get result from multile them.
Contract Value = Currency
Penalty percentage = Decimal
Over due date = glide date --> i get the value from today - end date (onChange=today)
I want to get value breach penalty from multiple 3 field. i use on change = over due date. i make this script. but it not working. please help. i can't do script well. thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2017 09:16 PM
This should help.
var con = g_form.getValue('u_contract_value').substring(4);
var per = g_form.getValue('u_penalty_percentage');
var total = parseFloat(con) * parseFloat(per);
g_form.setValue('breach_penalty_amount', total);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 07:12 PM
explorenow hello... i'm sorry for distrubing you. can you help me with this client script?? thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 07:47 PM
Please try like:
var date = g_form.getValue('u_over_due_date');
alert(g_form.getValue('u_contract_value')); //Let me know what are you getting here if this code is not working
var value = g_form.getValue('u_contract_value').substring(4);
var person = g_form.getValue('u_penalty_percentage');
var total = parseFloat(date) * parseFloat(value) * parseFloat(person);
alert(total);
g_form.setValue('breach_penalty_amount', total); //Please check the if the field name is correct, if it's a custom field then it should start with u_
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 08:19 PM
Hallo... thank you for response my questiion...
I have been try this script, and this is what i get form the script
var date = g_form.getValue('u_over_due_date');
alert(g_form.getValue('u_contract_value')); //This code is working, i get 1000 from this code
var value = g_form.getValue('u_contract_value').substring(4);
var person = g_form.getValue('u_penalty_percentage');
var total = parseFloat(date) * parseFloat(value) * parseFloat(person);
alert(total); //But in this code i get NaN
g_form.setValue('breach_penalty_amount', total); //This field is default by servicenow. i didnt create this field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 08:22 PM
Please check if this helps.
var date = g_form.getValue('u_over_due_date');
var value = g_form.getValue('u_contract_value');
var person = g_form.getValue('u_penalty_percentage');
var total = parseFloat(date) * parseFloat(value) * parseFloat(person);
alert(total); //What you get here?
g_form.setValue('breach_penalty_amount', total);