- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 07:25 AM
Create location in cmn_location table, Whenever user will select others in the location field, new field will display to provide new location details like street, city, state, country, postal code. For this requirement I am using onSubmit catalog client script and script include but this is not working.
Client Script:
Kindly guide if anyone implemented something similar to this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 11:29 PM
Hi @Dipika4 ,
For me its working fine in my pdi you can check from your end.
Scoped Application Script Logging. gs.print() and gs.log() are older and not available in scoped applications, whereas gs.debug(), gs.info(), gs.warn(), gs.error() work in both scoped applications and global.
Please mark it helpful and solution proposed.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 11:17 PM
Hi @Dipika4
This request will not reach your Script Include as the form will submit immediately after the GlideAjax call.
Try the following catalog client script, whether the request reached the Client Callable Script Include or not.
function onSubmit() {
var actionName = g_form.getActionName();
var obj = {
"location": g_form.getValue("new_location"),
"line": g_form.getValue("new_line1"),
"tdaLocationCode": g_form.getValue("new_TDALocationCode"),
"city": g_form.getValue("new_city"),
"stateProvince": g_form.getValue("new_stateProvince"),
"country": g_form.getValue("new_country"),
"postalCode": g_form.getValue("new_postalCode")
}
var ga = new GlideAjax("UserOnboardingNonTGELocation");
ga.addParam('sysparm_name', 'createLocation');
ga.addParam('sysparm_location', JSON.stringify(obj));
ga.getXML(getLocationDetails);
return false;
function getLocationDetails(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.submit(actionName);
}
}
Please mark my answer helpful and accept as a solution if it helped 👍✔️
Anvesh