You need to sign in to do that
Don't have an account?
Chamil Madusanka
Invoke APEX class via workflow
Hi All,
Are there any approaches to invoke APEX class via workflow?
Thanks in Advance
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi All,
Are there any approaches to invoke APEX class via workflow?
Thanks in Advance
Not directly, you can run Apex class methods through a trigger though, so I suppose you could write a trigger which ran the methods you want, and have a workflow that makes a field update to some hidden checkbox, which would in turn fire the trigger and you could say if (checkbox is ticked) {run apex class methods}
As a clarification to the above comment, the procedure outlined above is correct. Create a custom field, and have a Workflow Field Update update the custom field. Code your trigger such that it checks for the presence of the updated value. When workflow field updates cause a record to change, triggers are reevaluated. During the trigger, you can call any Apex Classes you desire (except callout functions; use @future for that).
Hi all,
Thanks for your reply. I have come up with new issue after read your comments. According to your reply, we can invoke a APEX class via field update workflow action and trigger. Trigger can invoke a apex class. It is obvious. Then we can only use triggers for such an invokation. If we use both workflow and triggers to invoke a apex class, then I think it will be wasted of performance and run time. I want to clarify it.Any Comments?
No I didnt say you can invoke apex through a field update, what I said was that you can invoke it by a trigger, so in order to fire the trigger you need some form of event like a field update. There is no way to invoke apex directly from a workflow so this is just a possible workaround.
Thank you in advance!