Client Script why can't use g_form.getQueryParameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
function onLoad() {
var myparam = g_form.getQueryParameter('myparam');
....
}
why ?
(g_env) [SCRIPT:EXEC] Error while running Client Script "Incident Demo01": TypeError: g_form.getQueryParameter is not a function
how to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I think it is getParameter. Try this code
function onLoad() {
var myparam = g_form.getParameter('myparam');
....
}
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
(g_env) [SCRIPT:EXEC] Error while running Client Script "Incident Demo01": TypeError: g_form.getParameter is not a function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The g_form.getQueryParameter() method is not a standard or documented method in ServiceNow's g_form API. The correct and widely used method for retrieving URL query parameters in client-side scripts is g_form.getParameter().
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Used under sow, it doesn't work