- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 07:44 AM
I'm running through an onSubmit() Catalog Client Script trying to get it to work.
When I run a getValue on a field during an onChange() script, I can see the value of the field I'm looking at no problem. As soon as it's an onSubmit() script though, I don't get a value returned to me.
function onSubmit() {
//Type appropriate comment here, and begin script below
var client = g_form.getReference('u_client', getClientEmail);
}
function getClientEmail(client) {
if (client.email != g_form.getValue('u_client_email')) {
var email = g_form.getValue('u_client_email');
alert("Email is: " + email + " and Client is: " + client.sys_id);
var ga = new GlideAjax('clientEmail');
ga.addParam('sysparm_name', 'getClientEmail');
ga.addParam('sysparm_client', client.sys_id);
ga.addParam('sysparm_email', email);
ga.getXMLwait();
}
}
You can see on lines 8 and 9 I'm doing a getValue, and on line 10 I'm just doing a sanity check to make sure that the different parameters I'm passing through to a Script Include actually work.
I've tried poking around to see if there was some conflict with doing a getValue on an onSubmit catalog client script, but nothing was jumping out at me. Does anyone have any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 11:49 AM
You should probably just do it right in the Script of the record producer itself and not as a Client Script. Are you only wanting to update that record, or are you actually creating another record? You can use a Record Producer to update records instead and just cancel the "normal" creation of the record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 08:35 AM
Is it returning null or just a blank value when you log out the value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 09:05 AM
Just blank. Both on the alert and when I log after passing it through to a script include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 09:09 AM
One other thing is that if you're already using an ajax call, I would not do the getReference() as you're doing 2 server roundtrips when you can do everything through the ajax call. Srinivas may be right that doing the getValue from inside the callback may be causing some issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 08:57 AM
Hi Bradford,
I suspect getReference CallBack in a onsubmit script is the issue.
I would suggest you to verify the same by adding return false at the end of the onSubmit script
Thanks
Srinivas