function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
james2000james2000 

update the same object from a trigger

From within a trigger, I have the need to update the same object. The update will occur asynchronously via a future method and the trigger will check the particular field that is being updated so it won't execute recursively.

 

In practice though, this doesn't appear to be allowed. When I try to execute my code, it doesn't even attempt to run my future method. I get this error:

 

SELF_REFERENCE_FROM_TRIGGER, Object (id = a0h80000001Y4Dd) is currently in trigger XYZ, therefore it cannot recursively update itself: []

 

Why is this prevented? Shouldn't a recursive error only be thrown when true recursion is detected?

 

Are there any workarounds? Thanks

 

james2000james2000
User error - please disregard.