I am new to servicenow, i want to know how to change hyperlink here

akankshar00
Tera Contributor

akankshar00_0-1733931054681.png

 

When a user clicks on create request from incident form, i want here to display the incident number

2 REPLIES 2

Bhavya11
Kilo Patron

Hi @akankshar00 ,

 

Here is the UI Macro, which shows the notification message in Catalog Home. Check this out.

 

ui macro name:sc_request_parent_message

Bhavya11_0-1734335079686.png

 

 

 

Sample script:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate jelly="true" >
	var req_parent_id = jelly.RP.getParameterValue('sysparm_parent_sys_id');
	var req_table_name = jelly.RP.getParameterValue('sysparm_parent_table');
	if(JSUtil.notNil(req_parent_id) &amp;&amp; JSUtil.notNil(req_table_name)) {
		
		var recGR = new GlideRecord(req_table_name);
		var recFound;
		if(recGR.isValid())
			recFound = recGR.get(req_parent_id);
			
		else
			gs.addErrorMessage(gs.getMessage('Invalid table in URL parameter'));
		if(recFound) {
			recGR.query();
			if(recGR.next()){
			var tableLabel =  recGR.getLabel();
			var recDisplayVal =  recGR.getValue('number');
			var displayLink = "&lt;a href ='/" + req_table_name + ".do?sys_id=" + req_parent_id + "'&gt;" + recDisplayVal + "&lt;/a&gt;"
			var notificationMsg = gs.getMessage("To View {0}, Click {1}", [tableLabel, displayLink]);
			gs.addInfoMessage(notificationMsg);
		}
	}}
</g:evaluate>
</j:jelly>

 

 

If you find my answer helpful, please give thumps up.

 

 

Thanks,

BK

 

Ankur Bawiskar
Tera Patron
Tera Patron

@akankshar00 

why do you wish to change the OOB message? Is this a customer requirement?

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