In Custom Portal Redirection is not working

HARSHA GOWDA R
Tera Contributor

I have created a UI Action named Access Graph and configured the redirection logic. The UI Action works correctly when accessed directly from the record form. However, in the custom portal, clicking the Access Graph button does not perform the redirection and instead displays the message "Record Updated".

The UI Action is configured with Client = False.

HARSHAGOWDAR_0-1780033421019.png

HARSHAGOWDAR_2-1780033674565.png

 

 

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@HARSHA GOWDA R 

action.setRedirectURL() doesn't work in portal. currently no workaround is available

UI Action setRedirectURL() ignored in Service Portal forms 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Tanushree Maiti
Giga Patron

Hi @HARSHA GOWDA R 

When you call action.setRedirectURL() inside a UI Action, the redirect does not execute in Service Portal. The form completes without navigating to the intended URL.

 

Refer : KB0722968 UI Action setRedirectURL() ignored in Service Portal forms 

 

Check this post once: 

https://www.servicenow.com/community/developer-forum/ui-action-to-redirect-to-portal-within-the-nati...

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

MariusAlinPopa
Tera Contributor

Hi @HARSHA GOWDA R , 

 

Try creating a new ui action with Client=True and add the following script:

 
function onClickRedirect() {
	try {
		var portalURL = '/iam?id=access_graph&sys_id=' + g_form.getUniqueValue();
		g_navigation.open(portalURL, '_blank');
	
	} catch (e) {
		g_form.addErrorMessage('ERROR: ' + e);
	}
}

Make sure to add 'onClickRedirect()' into the ui action 'onclick' field.

 

Let me know if it works,

Marius