Showing Relationships in Service Portal

alimaxi29
Mega Contributor

We are trying to view the related lists generated by relationship records on the form on the service portal. It appears that OOTB only links to related lists that are specific record references are shown.

We managed to configure a related list widget to show the lists but no filters are passed through for the relationship type lists. Has anyone managed to get this to work?

3 REPLIES 3

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi Ali,

 

Please refer the link below.

https://serviceportal.io/downloads/related-list-widget/

 

Hope this helps.

 

Regards

Ujjawal

Hi Ujjawal

I've tried this and it gives us the lists, and the counts appear correct, but in the server script it passes the following information:

var params = {
table: list.table,
filter: list.field+"="+data.sys_id;,
view: 'sp',
title: list.label
}; 

This results in an undefined filter rather than what should be provided by the relationship.

Thanks,

Ali

alimaxi29
Mega Contributor

Posting this in case anybody else has this issue. In order to get relationships rendering in the related list widget found here (https://serviceportal.io/downloads/related-list-widget/) replace the following lines in the server script:


var params = {
table: list.table,
filter: list.field+"="+data.sys_id,
view: 'sp',
title: list.label
};

with:

var params = {};
if(list.type == 'REL'){
params = {
table: list.table,
relationship_id: list.relationship_id,
apply_to: list.apply_to,
apply_to_sys_id: list.apply_to_sys_id,
view: 'sp',
title: list.label
};
}
else{
params = {
table: list.table,
filter: list.field+"="+data.sys_id,
view: 'sp',
title: list.label
};
}