Skip to main content
7 events
when toggle format what by license comment
Aug 13, 2019 at 11:10 answer added Phil W timeline score: 2
Aug 13, 2019 at 11:03 comment added Phil W OK, so you need to go the route of data that is computed and stored when changes happen to the source records. Note that this can be quite difficult to get right and you need to make sure each update to the computed "aggregates" is performed in a thread-safe manner (you will want to use FOR UPDATE to lock the record where you store these aggregates). It sounds like you will need different "aggregate" instances per record type given your comment above. Good luck!
Aug 13, 2019 at 10:44 comment added Sachin Singhal yes, my requirement is to calculate the values synchronously as records are being added, modified or deleted continuously as per client business. Client also wants to export the data in excel/pdf files. so they need latest data.
Aug 13, 2019 at 10:05 comment added Phil W The question is, can this value be calculated asynchronously and you show the date/time at which it was last updated as part of the presentation? Fundamentally, from my perspective and due to Salesforce restrictions, you either have to incrementally calculate these values during creation, updates and deletion of the relevant objects, holding the aggregate values in a special object from which you display the values, or you need to present details that are asynchronously calculated - and in this case you'd want to show when the calculation was last performed too.
Aug 13, 2019 at 9:48 comment added Sachin Singhal Yes, my requirement is to calculate and to show the data on VF page synchronously, as client requirement is to select the object name and show its count of records as per record type, sum of currency field data, show Max and Min data value of Date field etc. All this must happen on object selection from dropdown list.
Aug 13, 2019 at 8:42 comment added Phil W This is a tough one. You can't even use roll up summary fields (if you were able to define a relationship) since best practice states no more than 10000 child records for a given master record. Are you able to incrementally calculate these values in triggers for the objects for which you are wanting to show these values or to use a batch to calculate and store these values for presentation? The latter means async so the figures would not always be up-to-date but is that really important in your use case?
Aug 13, 2019 at 7:44 history asked Sachin Singhal CC BY-SA 4.0