+ Start a Discussion
SHAIK MOHAMMAD YASEENSHAIK MOHAMMAD YASEEN 

how to get rollup summary field using junction object

Hi All,

In my org I have three object obj1, obj2, obj3 and obj2 is junction object between obj1 and obj3. My requirement is i want a rollup summary field on obj1 which will calculate the minimim value of related obj3 field. 

Please help me how shalll i proceed in this case. Thanks

BEst Regards,
Mohammad Yaseen
Best Answer chosen by SHAIK MOHAMMAD YASEEN
Deepak Maheshwari 7Deepak Maheshwari 7

Hi,

 

You need to create a field on obj2 and will need to update that field by the field on parent object obj3 through workflow or process builder.

 

Then you can create Rollup summary field on obj1 which can find the min value.

 

Hope this will help you!

 

Thanks

All Answers

LBKLBK
You need a trigger to do that.

Refer the ticket below.
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000ICae

This is not exactly same as your requirement. However, this is about getting the minimum value rolled up in a Lookup relationship.

Hope this helps.
Deepak Maheshwari 7Deepak Maheshwari 7

Hi,

 

You need to create a field on obj2 and will need to update that field by the field on parent object obj3 through workflow or process builder.

 

Then you can create Rollup summary field on obj1 which can find the min value.

 

Hope this will help you!

 

Thanks

This was selected as the best answer
Vivian Charlie 1208Vivian Charlie 1208

Hi Mohammad Yaseen,

 

You can have an after trigger (insert/update/delete) on the junction object (obj2). Whenever the junction object record is manipulated you can access fetch the related Obj3 Id's in the trigger.new itself.

Once you have these id's you can query them to fetch the necessary details (manipulate them) and put this in a map of Obj3Id_Data. Then if you iterate again on the trigger.new you can fetch the value from the map.

for(obj2 inst : trigger.new){
inst.obj3Id; // fetch map value for this
inst.obj1Id; / you can then assign the value here by creating an instance of this object
}


Thanks

Vivian

SHAIK MOHAMMAD YASEENSHAIK MOHAMMAD YASEEN
Thanks @LBK and @Vivian Charlie 1208 for the trigger idea but i have to achieve it through configuration part
SHAIK MOHAMMAD YASEENSHAIK MOHAMMAD YASEEN
Thanks @Deepak Maheshwari 7 it worked for me by following your logic