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
Glen CubinarGlen Cubinar 

Run Visualforce Page from Trigger

Hi,

I have a class that is called by a visualforce page as shown below, and I would like to seek assistance on how can I run it using a Trigger.

Visualforce Page:

<apex:page standardController="Account" extensions="ArchiveController" action="{!submitRequest}">
    <apex:form >
        <apex:actionFunction name="cancelProcess" action="{!cancelProcess}"/>
    </apex:form>
   
    <script>
   
        var message = "{!message}";
        var checkProcess = "{!checkProcess}";      
    
        function Archive(){
            if(checkProcess == 'true'){
                 alert(message);
                 cancelProcess();
             }
         }
        Archive();
       
    </script>
</apex:page>




VPROKVPROK
Why do you need to do this? It looks like you want to call a method from a class?
You can just call the class instance from trigger, with the method you need. like:
new MyClassName.myMethodName(parameters);


Glen CubinarGlen Cubinar
Hi VPROk,

I would like to run sa VF page since in the class im getting some of the values from the controller.

 public ArchiveController(ApexPages.StandardController controller) {
VPROKVPROK
I don't think it is possible, but you can try returning a pageReference to this page + an ID of currently processing record.