- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2015 08:36 PM
So, Ive learned that there is a Client-Side Glide record, however there's not much of a difference between them except fewer functions
and the way its coded.
I read the API and tried that on my client script onSubmit. And when I tried it, it gave me an Error:
onSubmit script error: TypeError: GlideRecord is not a function:
function (){var o=i(m,arguments);return l.apply(n,o)}
What I'm currently trying to do is to get something out of the database.
function onSubmit()
{
var mngrsysid = g_form.getValue('sys_id');
var noOfEmp = 0;
var emptable = new GlideRecord('x_21272_jobmgmtapp_employees');
emptable.addQuery('number', mngrsysid);
emptable.query(recResponse);
function recResponse(emptable)
{
while(emptable.next())
{
g_form.addInfoMessage('Emp No: ' + emptable.number);
}
}
Can someone please help me figure it out, and tell me what I'm doing wrong.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2015 02:30 AM
Jamie,
From your written code, it seems that you are in scoped application and in scoped application Client side Glide Record is not present. Better is you use Script Include and by the way, Best practice is not to use Client side glide record.
--
Cheers,
AR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2015 09:30 PM
What happens if you remove the Function form the middle of the gliderecord? So:
function onSubmit() {
var mngrsysid = g_form.getValue('sys_id');
var noOfEmp = 0;
var emptable = new GlideRecord('x_21272_jobmgmtapp_employees');
emptable.addQuery('number', mngrsysid);
emptable.query(recResponse);
while(emptable.next()) {
g_form.addInfoMessage('Emp No: ' + emptable.number);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2015 02:30 AM
Jamie,
From your written code, it seems that you are in scoped application and in scoped application Client side Glide Record is not present. Better is you use Script Include and by the way, Best practice is not to use Client side glide record.
--
Cheers,
AR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2015 10:33 AM
Okay! Thank you! I created a business rule now instead of a Client Script. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2015 04:33 AM