+ Start a Discussion
Puja Gupta 18Puja Gupta 18 

please help to find correct answer

What are two considerations for deciding to use a roll-up summary field?
Choose 2 answers

Roll-up summary field can be performed on formula fields, but if their formula contains an #error result, it may affect the summary value.
Roll-up cannot be performed on formula field
Roll-up summary field do not cause validation rules on the parent object unless that object is edited separately.
Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW()

 

Please tell me correct ans.
 

Best Answer chosen by Puja Gupta 18
S95S95
1.Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW()
2.Roll-up summary field can be performed on formula fields, but if their formula contains an #error result, it may affect the summary value

thanks.

All Answers

S95S95
1.Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW()
2.Roll-up summary field can be performed on formula fields, but if their formula contains an #error result, it may affect the summary value

thanks.
This was selected as the best answer
Neelesh GothaniaNeelesh Gothania

Hi Puja,

You have already selected the Best Answer, but still I'm answering this as I believe my answers are different than the above one.

Correct answers would be 

B. Roll-up cannot be performed on formula field   

C. Roll-up summary field do not cause validation rules on the parent object unless that object is edited separately.

Reason:

B.  Roll-up cannot be performed on formula field   

Comment: This is true, you can not perform roll up on formula fields natively in salesforce, though you can do work around live update a value in another field and set rollup on that field.

Reference : This idea is there and it will not be implemented (https://success.salesforce.com/ideaView?id=08730000000BrUAAA0) as it is not on the product development teams priority.

C.  Roll-up summary field do not cause validation rules on the parent object unless that object is edited separately.
Comment: With general logic, if B is true, then A and D can not be true.

But I'm here with a reason

Which is, validation rules would run before a record is saved to database and roll up value updates after the value in the child is saved to the database.  So, Unless the object is edited separately, roll up can not be performed in this case.

Reference: Order of execution (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm)

 

If you agree on above and if possible can you mark the answer to best answer.

 

Thanks

Neelesh Gothania

Gug ChilGug Chil
Hi Neelesh Gothania
I think you are wrong!

Roll-up can be performed on formula field   
The best way to find out the answer is to check it by yourself, I've created a formula field on Opportunity which returns number, and then created a rollup summary on Account which couns the sum of my formula, and it works perfectly.

For the second part please see the following link  https://help.salesforce.com/articleView?id=fields_about_roll_up_summary_fields.htm&type=5 (https://help.salesforce.com/articleView?id=fields_about_roll_up_summary_fields.htm&type=5)
A roll-up summary field can trigger workflow rules and field validations. However, workflow rules and field validations do not fire when the following changes cause a mass recalculation of roll-up summary values:
Changing the roll-up summary definition (such as the object, function, or field being aggregated)
Changing the expression of a formula field referenced in a roll-up summary field
Replacing picklist values for picklist fields referenced in the roll-up summary filter
Changing picklist record type definitions
Changing currency conversion rates
Changing price book entries

Also, in the same link you can find the following statement:
If a roll-up summary field doesn’t contain cross-object field references or functions that derive values on the fly, such as NOW or TODAY, it can calculate the values of formula fields.

So the answer given by @Puja  is correct!