Request Approval UI Action in Agent Workspace

Gerard9
Giga Contributor

We are migrating the team into Agent Workspace and they love it.

But i cant get the "Request Approval" UI Action to work in the Agent Workspace.  It works fine in the classic UI.  The button appears in the Agent Workspace, but clicking the button does nothing.  What am i missing?  Screenshots below.

Thanks in advance

find_real_file.png

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi Gerard,

the correct code for the field "Workspace Client Script" must be as follows:

function onClick(g_form) {
	var ga = new GlideAjax("ChangeRequestStateHandlerAjax");
	ga.addParam("sysparm_name", "getNextStateValues");
	ga.addParam("sysparm_change_sys_id", g_form.getUniqueValue());
	ga.addParam("sysparm_change_type", g_form.getValue("type"));
	ga.getXMLAnswer(function(stateValues) {
		var returnedStates = JSON.parse(stateValues);
		
		g_form.setValue("state", returnedStates[0]);
		g_form.submit('state_model_request_assess_approval');
	});
}

 

There were two lines that do not work at Workspace and therefore were replaced by a modified version:

 

old new
var returnedStates = stateValues.evalJSON(); var returnedStates = JSON.parse(stateValues);
gsftSubmit(null, g_form.getFormElement(), 'state_model_request_assess_approval'); g_form.submit('state_model_request_assess_approval');

 

To my mind it makes no sense to "repair" all UI Actions for change requests. At the moment, the Agent Workspace is not a fully functional replacement for the classic user interface and there are some tools which cannot be rendert at Workspace (for example Confict Calendar).

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

View solution in original post

8 REPLIES 8

Apologies for the delay Maik,

 

Had a few priority issues crop up.  I had one of the team put this in and try it this afternoon and still not working as hoped.  I will investigate a bit further and let you know.

 

Thanks

Hi Maik,

As Gerard said,  I can confirm that altering the Workspace Client Script to what you suggested previously did not change anything unfortunately.

We receive this in the browser console:

js_includes_clientScript.js:4608 Unhandled exception in GlideAjax. Cannot read property '0' of null

If you have any further suggestions, we would greatly appreciate it!

Thanks,
Chris

Hi Maik,

Further to this, I used your advice in my personal developer instance and it worked as expected. When I try copying like for like into our DEV instance, still no good.

Thanks,
Chris

Chris Sutton
Tera Expert

Hi Maik,


This is working as expected, thanks so much for your Workplace Client Script!

Thanks,
Chris