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
Cool_DevloperCool_Devloper 

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,

Cool_D

Cool_DevloperCool_Devloper

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??

 

Thanks,

Cool_D

mtbclimbermtbclimber
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