OnClick of Report's details, it should redirect to portal.

Alok21
Giga Expert

Hi Team,

Need some insight on below query.

I have a dashboard which contains multiple reports. On click of the record, it is redirecting to the backend table but i would like to redirect to the portal and show the details with some static field as column. 

Regards,

Alok sahu

 

10 REPLIES 10

Hi Ankur,

Sure. Below is the approach i followed.

UI Script: 

var url=document.referrer;
if(url.toString().indexOf("pa_dashboard.do?sysparm_dashboard=sys_id")>0 && top.location.toString().indexOf("table_name_list.do")>0){
var ga = new GlideAjax('FormatUrl') ;
ga.addParam('sysparm_name','convertUrl');
ga.addParam('sysparm_currentUrl',top.location);
ga.getXMLWait();
top.location=ga.getAnswer();

}

Script Include:

var FormatNpbuUrl = Class.create();
FormatNpbuUrl.prototype = Object.extendsObject(AbstractAjaxProcessor, {

convertUrl: function(){
var currentUrl=this.getParameter("sysparm_currentUrl");
var convert=GlideSPScriptable().mapUrlToSPUrl(currentUrl+'');
var buildUrl="https://"+"instance_name"+".service-now.com/"+'portal_name?'+convert;
return buildUrl;
},
type: 'FormatNpbuUrl'
});

Regards,

Alok sahu

 

Hi Alok,

From where this script is getting called i.e. when it would run?

Regards

Ankur

 

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

Hi Ankur,

On click of reports details it gets called up.

Regards,

Alok sahu

Hi Alok- I have similar kind of requirement.Can you please tell how did you call the UI script?any specific table name?

 

Thank you!

vamshi krishna4
Giga Guru

Hi,

You can try adding the redirection link to the report on top of the drill down section.

https://docs.servicenow.com/bundle/orlando-performance-analytics-and-reporting/page/use/reporting/ta...

 

Thanks,

Vamshi Krishna S.