You need to sign in to do that
Don't have an account?
A.V.
Executing Apex Triggers Asynchronously
What is the best appoarch to execute Apex code asynchronously?
I have a scenario where I am copying attachments (with Apex Code) as a result of an Account record update. I would like to perform this in an asynchronous manner so that the UI response is not slowed when processing large attachments...
One way I can think of is with Workflow rules. I have not tried it yet, but I suppose it is possible to specify a time delayed workflow that would update some flag field, which in turn will trigger the code that will execute the code.
Is there a better way to do this? Once again, my objective is to kick off some code in a trigger but not having to wait for it to complete...
Thank you.
I have a scenario where I am copying attachments (with Apex Code) as a result of an Account record update. I would like to perform this in an asynchronous manner so that the UI response is not slowed when processing large attachments...
One way I can think of is with Workflow rules. I have not tried it yet, but I suppose it is possible to specify a time delayed workflow that would update some flag field, which in turn will trigger the code that will execute the code.
Is there a better way to do this? Once again, my objective is to kick off some code in a trigger but not having to wait for it to complete...
Thank you.
Superfell
Expose your apexCode as a webService, and use the Workflow Outbound Messaging feature. You'll just need a small endpoint hosted somewhere that takes the OM message and turns around and make the WS call back to your apex code.