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
Ritika ShoucheRitika Shouche 

Calling a Static method from Visualforce Page

Unable to Call a method from VF Page -

Method I am Calling is From a different class and not in Controller -
 
Public PageReference save() {
  
  UtilityClass.newLog(); 
  
  
  }

Trying to Call this Method from below VF ;-
 
<apex:form >
        <apex:pageBlock title="My Content" id="P1">
            <apex:pageBlockSection title="My Content Section" columns="1">
                <apex:inputCheckBox label="User Details" disabled="true" />
                <apex:inputCheckBox label="User Contacts" disabled="true"/>
                <apex:inputCheckBox label="User Access" disabled="true"/>
            </apex:pageBlockSection>
         <a class="btn" onclick="myFunction()" >Cancel</a>
            <apex:commandButton oncomplete="myFunction()" value="Edit" rerender="P1"/>
            <apex:commandButton action="{!save}" value="Save"/>
        </apex:pageBlock>
    </apex:form>

 
LBKLBK
Does this UtilityClass has a namespace? If yes, you have to do NAMESPACE.UtilityClass.newLog();


Or, is it an inner class of another parent class? If yes, you may have to use PARENT_CLASS.UtilityClass.newLog();