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

Adding an anchor link to info message to navigate to another Workspace tab

davilu
Mega Sage

Hello community, we have a requirement to show an info message on case submission in Workspace that has a link to a related link tab reminding end users that they must enter records.  

 

Currently, we've tried this:

gs.addInfoMessage('Please make sure to enter in your action values in the <a href="/now/hr/agent/record/sn_hr_core_help_desk/ee5093c0475c7e50c0b0b995136d43e2/params/info-message/Corrective%20Action%20case%20was%20created/selected-tab-index/1">Corrections</a> tab!')

 

This works...but has a pretty janky user experience.  It will do a full page reload and once the page renders, the user is on the correct tab.  Is there a way to accomplish this without a full page reload?

1 REPLY 1

kaushal_snow
Mega Sage

Hi @davilu ,

 

While your anchor link works, it forces a full page reload since it’s treated like a regular link; to avoid that you’d need to use supported client scripts / Workspace APIs (for example g_aw.openRecord() / GlideAgentWorkspace) so that clicking the link triggers a workspace tab navigation instead of a browser load; alternatively, you can trick the system by prefixing extra slashes in internal URLs (so ServiceNow thinks it’s external) to force an external browser tab, but that’s hacky and can break in future versions...

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/