Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I want changes to detail objects to trigger a workflow on the master object.

The master object has a rollup summary field which COUNTs how many detail objects have a certain field set. When I change a detail object, the formula field on the master is changed to reflect this but this "change" to the master object's formula field does not seem to trigger the workflow.

I guess I could make a trigger on the detail object which does a dummy update on the master but this seems inelegant. Workflows apparently don't get triggered by changes to rollup-summary fields - is there a better way?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

A change to the value of the roll-up summary field on the master/parent triggered by a change on the detail/child's field that feeds into the roll-up summary should fire the workflow rule on the parent.

The parent roll-up summary will be affected when the child value changes. For example, if you have a blank in the child field value and it stays blank the parent save will not be triggered. Likewise if you have a value and it doesn't change the parent save will not be triggered.

You can use the ISCHANGED function. You just have to make sure that the evaluation criteria on the workflow rule is created, and every time it’s edited.

Assuming a roll-up summary field called Children_With_Value_Set__c that counts the child records where the field value is not blank, the following should be set in the workflow (also make sure the workflow rule has been activated).

Rule Criteria ISCHANGED( Children_With_Value_Set__c )

Evaluation Criteria Evaluate the rule when a record is created, and every time it’s edited

See triggers and order of executions as well as about roll up summary fields for more information.

share|improve this answer
    
You are right! I must have had some other logical problem because now I see my workflow is running when rollup fields are changed because of detail object changes. Cool of SalesForce and thanks to you! –  Marc Feb 26 '13 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.