You need to sign in to do that
Don't have an account?
SHAIK 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
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
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
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.
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
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.
Thanks
Vivian