Related Fields Totalling

Posted by on 22-May-2017 19:53

Can a related field (currency for example) be totalled inside a report or list view? 

All Replies

Posted by Shivani Silveri on 23-May-2017 06:29

Hi Eric,

The related field cannot be used for totaling. You could use an Expression field to achieve this.

Could you let us know the scenario that you are trying to achieve?



Posted by Shiva Duriseati on 23-May-2017 08:27

Hi Eric,

You could use following code in HTML template report to get the sum of all related field(Currency type) for each record.


I have created two objects ObjectOne and ObjectTwo with 1-1 cardinality . Created "Currency Field" in ObjectTwo ,used related field in ObjectOne as "Currency Field". In HTML template report used following code. Please note there could be another way to do this.I have used simple method by looping all the records in "ObjectOne" and summed up related fields(currency fields).




function sum() {

var sum=0;


var number = Number("{!relatedfield}".replace(/[^0-9\.]+/g,""));




document.getElementById('id').innerHTML = sum;




<body onload="sum()">

<span id="id"></span>




Please find attached app.xml for your reference.




This thread is closed