- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:43 AM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var Emp = new GlideRecord('sc_req_item');
Emp.addQuery('sys_id', newValue);
Emp.query();
while(Emp.next()) {
g_form.setValue('u_first_name', Emp.variables.u_first_name);
}
}
i used this code but this gives me undefined in my coloumn
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 12:09 PM
Hi Manohar,
Please check this link https://community.servicenow.com/thread/219073?q=use%20script%20include%20value%20in%20client%20scri...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:48 AM
Hi
Variables can not be accessed from a Client Script even using very limited GlideRecord object.
You should use Clien-Callable Script Include called through GlideAjax. You pass paramters and get the result of teh server processing. See more here:
Regards
Nikita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:48 AM
Hi Manohar,
Your onChange client script, what table/field is it reacting to? I'm trying to determine what newValue is supposed to be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:50 AM
its a sysid of request item(sc_req_item)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:56 AM