function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Trying to Get a Total from a custom object (related list) - but cannot use Roll-up Summary

I have three custom objects that are related as follows:






Each has a one to many relationship to the one below (1 project can have many shipments; each shipment can have many batches)


I want to display a total value in the Shipment object for the batches - for example, there may be 10 batch records related to one shipment and I want to sum the total value of all the batches in the shipment level.


I cannot create a master detail relationship between Shipment and Batches; because Shipment is already a "Detail" side of a relationship with the Project - so therefore, as I understand it, I cannot create a roll-up to use the Sum feature).


I tried creating a look-up on the Shipment table to the Batch Table to enter a custom formula to the Batch_Value field, but it does not give me a total (it just gives me 0 as the value).


Can anyone help me either with this formula or how to get a total of all related batches into my shipment table?







Hi Hugo_B,


I think you'll need a trigger to achieve this. Let me know if you need any assistance.




Thanks and yes, I may need some assistance.  I am getting my feet wet with and although I am familiar with coding (VB, some C) and SQL, I have not had the opportunity yet to delve into how these two items work with Salesforce.

someone has done some preliminary work on the Apex code to do this here.  Unfortunately this is beyond my skill level to deploy this.  there are also several longstanding ideas oon the Idea Exchange around this that have recently been merged into one, vote on it here.


If anyone here does manage to get this working, I really need it - please hook me up!!


bcolmer at gmail dot com