Skip to main content
Added case number
Source Link
Jeff Trull
  • 698
  • 1
  • 8
  • 15

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

Update: this is now filed as case 09012899

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

Update: this is now filed as case 09012899

linkified the trigger order of execution document
Source Link
Peter Knolle
  • 29.2k
  • 12
  • 104
  • 164

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution documenttrigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?

Tweeted twitter.com/#!/StackSalesforce/status/268303574642065408
Source Link
Jeff Trull
  • 698
  • 1
  • 8
  • 15

Delete of former parent in trigger causes workflow failure on child

I have a Lookup relationship from Contact to a custom object, and an "after update" trigger on Contact that deletes any of those related objects that no longer have children. There is a workflow rule on Contact that references fields from the parent object. I find that when I change the related object - i.e., reparent the Contact - and the old parent is deleted by the trigger, the save fails with the following error message:

The formula in the "TestRelatedWorkflow" rule or process is invalid due to the following: The record you attempted to access has been deleted

It seems to me that the workflow rule should be referencing the new (updated) parent object and its fields, not the old (deleted) parent. I read the trigger order of execution document carefully, and it seems to indicate that workflow rules should be evaluated after all triggers. Am I missing something? Is there a sensible workaround?