Timeline for Delete of former parent in trigger causes workflow failure on child
Current License: CC BY-SA 3.0
20 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 6, 2014 at 18:26 | vote | accept | Jeff Trull | ||
Jan 6, 2014 at 18:26 | answer | added | Jeff Trull | timeline score: 0 | |
Jan 6, 2014 at 18:21 | comment | added | Jeff Trull | I tried this again in Winter 14 and found that the problem has vanished. Neither the original issue nor my simplified test case demonstrates this anymore, although previously it was easy (for me) to reproduce. I suspect the platform has quietly been fixed, and I'm closing this question. | |
Apr 9, 2013 at 19:33 | history | edited | Jeff Trull | CC BY-SA 3.0 |
Added case number
|
Jan 14, 2013 at 22:36 | comment | added | Jeff Trull | I've performed another two experiments recently that may be interesting: 1) create a formula field on the child object with the value of the workflow rule and use that field instead of the related object reference. Result: fails the same way. 2) Defer related object delete to a @future method. Result: success! Though this may not be an acceptable workaround... | |
Jan 13, 2013 at 19:19 | comment | added | Jeff Trull | Bob, I also did the experiment of trying the same reparenting from (anonymous) Apex instead of the UI. Result was identical. | |
Dec 26, 2012 at 6:34 | comment | added | Jeff Trull | Bob, I can confirm that with Contact changed to a new custom sObject ("TestChildRecord") and the trigger moved and workflow rule moved, the same behavior occurs. | |
Dec 26, 2012 at 5:47 | comment | added | Jeff Trull | Hi Bob, thanks for investigating and for your comment. It's being reparented from the UI; the trigger code (linked above) looks for parent objects that no longer have children and deletes them. There are in fact multiple workflow rules and triggers defined on contacts in addition to the ones with issues; if you mean to suggest one of those may be the issue I think you're right and it's worth ruling that out. I will make a new test case with brand new custom objects and report back. | |
Dec 19, 2012 at 17:22 | comment | added | Bob Buzzard | Is this being reparented from the standard UI, or from some apex code? I've tried reproducing this in my dev org but have been unable to. I was able to get the trigger to throw an error by introducing a field update to my workflow, but not the workflow rule itself. Do you have any other workflow rules/actions or triggers on the Contact object? | |
Dec 19, 2012 at 1:10 | history | edited | Peter Knolle | CC BY-SA 3.0 |
linkified the trigger order of execution document
|
Dec 18, 2012 at 12:08 | answer | added | Andres Perez | timeline score: 1 | |
Dec 13, 2012 at 20:25 | comment | added | Jeff Trull | Hi Adam, the code is linked to in the comment two above yours, from November 13... Would be delighted to have some help on this if you have ideas. | |
Dec 12, 2012 at 18:19 | comment | added | Adam | Please post sample code or close this out. | |
Nov 13, 2012 at 10:45 | history | tweeted | twitter.com/#!/StackSalesforce/status/268303574642065408 | ||
Nov 13, 2012 at 1:20 | comment | added | Jeff Trull |
And the workflow activation rule: !TestRelatedObject__r.SomeBoolean__c
|
|
Nov 13, 2012 at 1:07 | comment | added | Jeff Trull | Sure, why not? trigger code | |
Nov 13, 2012 at 0:44 | comment | added | techtrekker | Are you able to post your trigger code to understand what it does? | |
Nov 13, 2012 at 0:19 | comment | added | Jeff Trull | It wasn't, but it is now. No change in behavior. It looks like that box relates to the re-evaluation of workflow rules when you change a field as a result of a workflow action, and not to the evaluation of the rule itself. | |
Nov 12, 2012 at 23:49 | comment | added | eyescream | Is the "Re-evaluate Workflow Rules after Field Change" ticked on the action triggered by the workflow? | |
Nov 12, 2012 at 23:44 | history | asked | Jeff Trull | CC BY-SA 3.0 |