- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 04:39 AM
HI Community,
I have a requirement, in catalog form there are 2 variables (see screenshot)
whenever the value entered in Expected Yearly Mileage (km) - Total then that value needs to multiply by 36 and populate in Estimated mileage Km per 36 months
For example; if i enter 11 in first variable then 396 (36 x 11) needs to be populate in second variable how can we achieve this
Please help me with the onchange client script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 05:19 AM - edited 08-19-2025 05:20 AM
There was an error in the script try below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 04:46 AM - edited 08-19-2025 05:04 AM
Write an on change client scripts on expected milage field:
var mil = parseInt(g_form.getValue(newValue));
g_form.setValue(‘yearly_var_name’, mil*36);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 05:16 AM
HI @RaghavSh ,
Thanks for the response,
I have written like this but it did not work
Can you please let me know what mistake i have done
It populates but showing as empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 05:19 AM - edited 08-19-2025 05:20 AM
There was an error in the script try below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 05:21 AM
Hi @suuriyas ,
Can you please share complete screenshot of the script where i can see Table and on which fiedl change you are doing it?
regards,
Nikhil Bajaj
Regards,
Nikhil Bajaj
ServiceNow Rising Star-2025