Cancelling transaction Script include not working

ankit_sharma487
Kilo Guru

Hi Team,

 

i am trying to populate some field value from a User record via On Change catalog client script and getting this message in logs

 

Cancelling transaction #67630 /angular.do (cancelled by other transaction) angular.do?sysparm_cancelable=true&sysparm_type=sp_ref_list_data

1 ACCEPTED SOLUTION

@Anurag Tripathi : i checked again found that i was passing the name of method/function wrongly - resolved now

 

thanks

View solution in original post

10 REPLIES 10

Allen Andreas
Administrator
Administrator

Hi,

Not too sure about that log message, but can you post briefly what you're trying to do?

Perhaps there's an issue with your script include. Unfortunately, you didn't provide information if this worked previously or not, or if this is brand new development (thus errors and such may be expected).

Please mark reply as Helpful, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

variableset variable name = ref_requester

on change of this variableset variable the manager, location and department should be changed

 

script include - client callable 

var MWNUserUtils = Class.create();
MWNUserUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {

	getUserDetails: function(){

		var id = this.getParameter("sysparm_id");
		var gr = new GlideRecord("sys_user");
		gr.get(id);

		if (gr.next()) {


			var dataArray={"manager": gr.getValue('manager'), "location": gr.getValue('location'), "department": gr.getValue('department') };
			return JSON.stringify(dataArray);
			
		}
		

	},	





	type: 'MWNUserUtils'
});

 

catalog client script:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	
	
   var ajax = new GlideAjax('MWNUserUtils');
	ajax.addParam('sysparm_name', getUserDetails);
	ajax.addParam('sysparm_id',g_form.getValue('ref_requester') );
	ajax.getXML(getResponse);
	
	function getResponse(response){
		var answer = response.responseXML.documentElement.getAttribute("answer");
		var obj= JSON.parse(answer);
		alert("response: " + obj.manager);
		g_form.setValue('ref_location', obj.location);
		g_form.setValue('ref_business_unit', obj.department);
		g_form.setValue('ref_reporting_to', obj.manager);
	}
   
}

@Anurag Tripathi : i checked again found that i was passing the name of method/function wrongly - resolved now

 

thanks

Anurag Tripathi
Mega Patron
Mega Patron

Can you show your script? 

Is it taking too much time or something?

Is the behavior same when you try from portal Vs when you try from native ui?

 

-Anurag