GlideAjax in UI Component
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 06:59 AM - edited 01-21-2025 07:00 AM
Hello,
I need to create a new UI Component for workspace to manage a custom feature on records (and not on lists).
I'm new to UI Builder and UI components so it is already painful. But I stumbled on something I need confirmation and I can't find this in the documentation.
Is GlideAjax really unavailable inside a UI Component ?
If yes, the workaround is to create page-related objects and link them to the ui component ?
If no, please enligth me !
Thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 01:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:01 AM
Hello @IronPotato,
I just want to use GlideAjax in a Custom UI Component. I noticed that the first GlideAjax call return an error : GlideAjax is not defined
But at the second call, the GlideAjax seems to work correctly.
For illustration, the code from the UI component :
function getGlideAjaxAnswer(method, parameters) {
return new Promise(function(resolve) {
var ga = new GlideAjax("...");
ga.addParam("sysparm_name", method);
[...]
ga.getXML(callback);
function callback(response) {
try {
resolve(JSON.parse(response.responseXML.documentElement.getAttribute("answer")));
} catch {
resolve(null);
}
}
});
}
somevar= getGlideAjaxAnswer(somemethod, glideAjaxParams);
Thanks for your help.