Retire UI Action is not working in the Workspace

Pranays45825922
Tera Contributor

There is a Retire UI Action that works fine in the platform view, but when I try to run the same UI Action from Workspace, it doesn’t work. I am attaching screenshots of the Retire UI Action for reference.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Pranays45825922 

Seems you customized the OOTB Button and included confirmation and made the UI action as Client + Server

The OOTB button will work for workspace as well.

AnkurBawiskar_0-1759129087636.png

 

for workspace you need to write script in workspace client script

1) get confirmation and then use g_form.setValue() to set value and update, you can't run server side code directly in workspace client script, either use GlideAjax and call it from workspace client script and move entire server side code in script include

How to use UI Actions in Workspaces 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Pranays45825922 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Pranays45825922
Tera Contributor

Solution : 

function onClick(g_form) {
//alert("1.  UI Action clicked.  Client Side Code Activated.");
	var prompt = "Do you want wish to continue?";
	
	var bConditionPassed = g_modal.confirm(prompt);
	if (! bConditionPassed)
	{		
		return false;
	}
	var actionName = g_form.getActionName();
	g_form.submit(actionName);
		
}