Find your content:

Search form

You are here

How can I get list of all workflow rules using apex?

 
Share

How can I get list of all workflow rules using apex? I want to retrieve names of all workflow rules using apex code.


Attribution to: Manisha

Possible Suggestion/Solution #1

I've been successful in getting parts of the Metadata API working from Apex using the WSDL2Apex tool and a few tweaks! However the listMetadata operation in respect to Workflow does not quite return what you would expect. Take a look at this answer for more info. Hope this helps!

https://salesforce.stackexchange.com/a/2208/60


Attribution to: Andrew Fawcett

Possible Suggestion/Solution #2

I haven't done it myself, but I think you could call the metadata api from apex and than process the output.

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_workflow.htm


Attribution to: Samuel De Rycke

Possible Suggestion/Solution #3

Unfortunately I believe you would need to use the Metadata API for this, which requires processing outside of Apex (from Heroku in Python/Ruby, for example). However, if there's a way to get this done from within Apex, I'll be really happy to learn about it!


Attribution to: Adam
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1077

My Block Status

My Block Content