GlideAjax in UI Component

regis_sarle_ev1
Tera Contributor

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.

2 REPLIES 2

IronPotato
Mega Sage

Hi @regis_sarle_ev1 ,

 

what is that custom functionality that you cannot acheive on record?

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.