Hello Julien,
This is possible with the SavedQuery feature and some JavaScript code that executes on the column.
I will provide some sample steps to do something similar to what you want, but with contacts under accounts instead of your custom relationship.
Firstly you would have to create a SavedQuery that takes in the parameter of the row and returns a list of results:
<fetch version="1.0" mapping="logical" output-format="xml-platform">
<entity name="contact">
<attribute name="contactid" />
<attribute name="fullname" />
<filter type="and">
<condition attribute="parentcustomerid" operator="eq" value="@p1@" />
</filter>
</entity>
</fetch>
Secondly an additional "Literal" type column should be added to your grid to show the relationship results, make sure to add the code to the format HTML section:
<script>GetRelationships({5})</script>
Now, add a JavaScript widget to the page and put in the following script, changing the URL and output to your liking:
function GetRelationships(info) {
var accntId = info.primaryId;
if(accntId) {
var contacts = $.ajax("http://www.website.com/SavedQueryService/Execute/getcontactsforaccount/"+accntId,{
async:true,
}).done(function(data) {
if(data&&data.length) {
var cell = $("#"+info.cell.id);
var html = "";
for(var i=0;i<data.length;i++) {
html+=data[i].Attributes["fullname"];
if(i != (data.length-1)){
html+="<br/>";
}
}
cell.append(html);
}
});
}
}
Ensure the JavaScript widget is configured to include in the
head tag.
Finally your grid should look something like this:
If you have any questions feel free to let me know.
Regards,
Clinton
Last modified on 28 Jun 2016 14:06 by Clinton Bale