Activity › Forums › Salesforce® Discussions › How to differ between rollup-summary and formula fields using APEX Schema functions?
Tagged: Apex Schema Functions, Difference, Master Detail Relationship, Master Object, Related List, Rollup Summary, Salesforce Formula Field
-
How to differ between rollup-summary and formula fields using APEX Schema functions?
Posted by chanchal kumar on July 20, 2018 at 11:41 AMHow to differ between rollup-summary and formula fields using APEX Schema functions?
shariq replied 7 years, 9 months ago 4 Members · 3 Replies -
3 Replies
-
Hello Chanchal,
Roll up summary field can only be defined on the master object, i.e master in the master-detail relationship, while your formula fields calculate values using fields within a single record. And roll-up summary fields calculate values from a set of related records, such as those in a related list, like contacts in Account.
Thanks.
- [adinserter block='9']
-
A Rollup Summary field is used to calculate the sum of a fields in the child object record. It is compulsory to be in a Master-Detail relationship to use the rollup summary. Where as formula field is mostly used for calculations with in acertain object. And it is child to Parent.
Thanks
-
Hi,
When you describe a Rollup Summary Field, its describe returns null when you call getCalculatedFormula(), unlike a Formula Field.
system.assertEquals(null, rollupDescribe.getCalculatedFormula());
system.assertNotEquals(null, formulaDescribe.getCalculatedFormula());Hope this helps.
Log In to reply.