+ Start a Discussion

How to use/invoke "execute Anonymous" calls from Apex/Controller

Hello Friends,


Is there a way to invoke "executeAnonymous" calls from within Apex or a VisualForce Controller?


I know it can be executed through Eclipse IDE as well as from the Debug Log, but i am not sure how to do it through Apex.


Could not find any reference to this in the Docs/Wiki as well. Any help with this will be highly appreciated!!


Many Thanks,



One more thing,


I am not sure how and where can i write an Anonymous Block of APEX code.


Is there a seperate declaration required??




You can't invoke executeAnonymous from another block of Apex.  Execute anonymous is a separate entry point to compile & run a routine which can only be invoked through the API verb -  see the apex WSDL: /services/wsdl/apex