- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 03:33 AM
client side:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 08:24 PM
you have the 3 lines commented and hence you won't get the value from client side to Server side via Ajax
Also the syntax is this.getParameter() and not gs.getParameter()
It seems you want to re-use the function both from GlideAjax and via server side. If yes then update the 3 lines as this
calculateTotalCost: function(vehicleId, startDate, endDate) {
// var vehicleId = gs.getParameter('sysparm_vehicleId');
//var startDate = gs.getParameter('sysparm_startDate');
//var endDate = gs.getParameter('sysparm_endDate');
var vehicleId = this.getParameter('sysparm_vehicleId') || vehicleId;
var startDate = this.getParameter('sysparm_startDate') || startDate;
var endDate = this.getParameter('sysparm_endDate') || endDate;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 06:18 PM
You have the lines to get the values from the client script commented out:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 08:19 PM
same issue with var startDate = gs.getParameter('sysparm_startDate');
i used below method and it worked fine. not sure why but thanks for help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 08:24 PM
you have the 3 lines commented and hence you won't get the value from client side to Server side via Ajax
Also the syntax is this.getParameter() and not gs.getParameter()
It seems you want to re-use the function both from GlideAjax and via server side. If yes then update the 3 lines as this
calculateTotalCost: function(vehicleId, startDate, endDate) {
// var vehicleId = gs.getParameter('sysparm_vehicleId');
//var startDate = gs.getParameter('sysparm_startDate');
//var endDate = gs.getParameter('sysparm_endDate');
var vehicleId = this.getParameter('sysparm_vehicleId') || vehicleId;
var startDate = this.getParameter('sysparm_startDate') || startDate;
var endDate = this.getParameter('sysparm_endDate') || endDate;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader