 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate you about roll up summary field that works with the help of master detail relationship. If you want to follow Salesforce related video series, you can search on YouTube by my name. So first I'm going to search for existing objects. So I have two custom objects, employee and student on employee. I have created master detail relationship. So it is related to opportunities, right? So remember that you can create roll up summary field on only on the master side, not on detail side. So we need to open the opportunity first. So I'm opening opportunity fields. These are the standard fields of opportunity object. And here we have custom. So now I'm going to click on you to create roll up summary field. So here it is, you can read the description also. So it says a read only field that displays the sum minimum or maximum value of a field in a related list or the record count of all records listed in a related list, right? So now we are going to create it. So it will be placed on opportunity record and it will be read only. So label will be employee count. You can also fill description and help text as per the requirement. Now here you can see options. So first we have master object that is opportunity. It is by default selected then summarize object. So opportunity has three detail object or child objects. So we are going to work on employees. So I'm selecting employee. Then I just want to count right now, like how many, how many employer records are related to one opportunity. You can also apply some max or men for that you need to select a particular field so that some may not max can be calculated. Then here filter criteria is available. So it says all records should be included in the calculation. Then second says only records meeting certain criteria should be included in the calculation. So if you click on this checkbox. So here you can apply some criteria as per this criteria, the records will be included in the calculation. So right now I want to include all the records for the calculation. Then I'm clicking on next. This field should be visible on should be visible and editable for all the profiles. Then it should be visible on all opportunity layouts and I'm clicking on save. So now I'm clicking on this plus to show all the tabs. So I'm opening the opportunity. I'm opening this opportunity. Let's see whether it is having any employee record related or not. Yeah, it has one employee record related. So let's see the detail page. So here we will be having employee count. So here it is employee count is one. Now if I create one more employee record and click on save. So this is not matching. Okay, this is I think because of filter criteria. Yeah, it stays as closed one and for this lookup like filter criteria value is a prospecting. So let's search that let's remove the filter criteria so that it will work properly. Yeah, here we have this filter criteria. So I'm clearing it as of now for the demonstration purpose only. So now if I add one more employee. So now you can see it is saved moving to this opportunity. And this time you can see the employee count as two and we have two records. So this way you can have a roll up somebody field on the parent side, or you can say on the parent record so that you can have some calculation related to child records. Right now let me create one more roll up somebody field that will be either some max or min. So before that, on employer, we need to have one number field so that we can have the total etc. So let me create one new number field. So I'm creating this number field on employer. So it will be salary visible and editable for all profiles should be available on the layout. So it is created. Now, moving to employer. So we have to employ records. So I'm filling salary as value 10,000 for this and for second one is 20,000. So we have to employ records having salary as number field now on opportunity. We are going to create one more roll up somebody field total. So now when I am selecting that object, then this time no look type is some and choosing field as selling should be available and should be visible and editable for all the profiles. Should be available on the layout and I'm clicking on save. Now moving to opportunity. Refreshing it. So here you can see it is having one more field that is employee salary total and total is 30,000 because it is linked with two employees. Now if I modify it. Suppose 40,000 so that total will be modified automatically and refreshing the opportunity. So you can see here total is 50,000 40 plus 10. So this way you can have a roll up somebody feels on parent side or parent record. So I hope you understood how we can implement roll up somebody field in Salesforce. If you want to watch more Salesforce related videos, you can search me on YouTube by my name. Thank you for watching this video.