- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2025 08:22 AM
I'm working on a UI page. I need to load some values from a table into a slushbucket for users to choose. The problem is that in the callback function, I can not access the GlideRecord object. Here is my code:
function _getAMFEntriesForSlush()
{
var amfGR = new GlideRecord('u_amf_entry');
amfGR.query(_amfCallBack);
}
function _amfCallBack(amfGR)
{
alert("hi" + amfGR); // I get this alert
alert("hi " + amfGR.getRowCount()); // I do not get this alert
// none of the following happens
while (amfGR.next())
{
var amfName = amfGR.getValue('u_name');
var amfID = amfGR.getValue('sys_id');
amf_slush.addLeftChoice(amfID, amfName);
}
}
The code to populate the slushbucket never gets run. I put in some alerts to see where the code is failing. I get that first alert, and it says "hi [object Object]". I do not get the second alert, which tells me there's a problem with referencing the GlideRecord object. Why?
What's really frustrating is that I have done this exact thing before and it works perfectly. I copied that code to write this. The other code works, but this doesn't.
Here's a the reference I used about client side GlideRecords:
Any help or thoughts would be appreciated. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2025 12:25 PM
I ended up creating a whole new UI Page and copying the code into the new page. It works with no changes. No idea why the previous page didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2025 12:25 PM
I ended up creating a whole new UI Page and copying the code into the new page. It works with no changes. No idea why the previous page didn't work.