Glide Record not found for hasNext
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 05:44 AM
My requirements are to query the Incident table on submit from the portal to identify any potential similar issues at the same location; alert the user they may be creating a duplicate record; and confirm they want to proceed with opening the new Incident. Using the below script in a Catalog Client Script, however, I do not get the expected confirmation window. I even commented out the query for the custom location field and tried to pull results for any Incidents in an open status. Still, I get no confirmation window. Is there something I'm missing from the below code?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2025 08:57 AM
There's a limit to the commands you can use on a Portal catalog client script. So for your statement
incidentGr.query();
You would need to add a function below that to handle the processing of the query, so it would look like this:
incidentGr.query(processQuery);
function processQuery(incidentGr){
if (incidentGr.hasNext()) {
...
}
}
Unfortunately, you can't return false from within that function to the entire client script, so doing this in an onSubmit script doesn't work well. You will need to either do it in an onBefore Business Rule or use an AJAX call to a script include as others have suggested.