The CreatorCon Call for Content is officially open! Get started here.

UI Action does not work

Alon Grod
Tera Expert

Hi,

Im trying to create a UI Action on a a list. Why Im not getting any log?

Screenshot 2023-10-01 at 12.23.38.png

Screenshot 2023-10-01 at 12.24.46.png

 

Screenshot 2023-10-01 at 12.25.09.png

1 ACCEPTED SOLUTION

@Alon Grod Please update your UI Action code as follows and it should work.

 

function myFunc(){
	var glideAjax = new GlideAjax('alonTest');
	glideAjax.addParam('sysparm_name','isTest');
	glideAjax.getXML(responseCallback);

	function responseCallback(respone){
		alert('response received');
	}
}

View solution in original post

8 REPLIES 8

@Alon Grod Just responded with updated code in please check. I have tested it on my instance and it is working with the following code.

 

function myFunc(){
	var glideAjax = new GlideAjax('alonTest');
	glideAjax.addParam('sysparm_name','isTest');
	glideAjax.getXML(responseCallback);

	function responseCallback(respone){
		alert('response received');
	}
}

@Alon Grod Please update your UI Action code as follows and it should work.

 

function myFunc(){
	var glideAjax = new GlideAjax('alonTest');
	glideAjax.addParam('sysparm_name','isTest');
	glideAjax.getXML(responseCallback);

	function responseCallback(respone){
		alert('response received');
	}
}

Anand Kumar P
Giga Patron

HI @Alon Grod ,

Uncheck client checkbox and try below code by replace with your script include name and function name.

 

 

1. Server side UI Action ( 'Client' check box on the UI action is un-checked), Call like a server side function
var callServerClass = new aoneTest();
callServerClass.isTest();

2. Client side UI Action ('Client' check box on the UI action is checked), You can use glide Ajax
var ga = new GlideAjax('aloneTest');
ga.addParam('sysparm_name','isTest');
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    alert(answer);
}

 

 


 Thanks,

Anand