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
KRayKRay 

Using ActionFunction in extension class

Hi everyone, I'm running into a snag accessing a method from the extended the class. I receive the following error message,Error: action="{!setInfo}": Unknown method 'AccountStandardController.setInfo()'.

  I exteneded it because I want to be able to use (Account) object publisher action in SF1. Right now, I'm back tracking to find out what's wrong. I've stripped it down to the bare essentials, still errors out. Any help will be greatly appreciated. Thanks in advance.

VFPAGE:
<apex:page standardController="Account" extensions="MyControllerEXT" >
   <script type="text/javascript">
      function GoToNxtPg(num){

     sendDataToController(num);
     sforce.one.navigateToURL("/apex/NextPage");

     }
</script>

<button onlick="GoToNxtPg('101');">GO</button>
<apex:form >
  
    <apex:actionFunction action="{!setInfo}" name="sendDataToController" rerender="">
         <apex:param name="passInvoice" value="" assignTo="{!SelectInvoiceNumber}"/>
     </apex:actionFunction>
</apex:form>



Controller:
global with sharing class MyControllerEXT{
public String SelectInvoiceNumber{get; set;}
public MyControllerEXT(ApexPages.StandardController Account){
       
    }
public void setInfo(String txt){
  
   
    }
}

Best Answer chosen by KRay
KRayKRay
Hi everyone, I scrubbed the actionFunction and passed the value directly using sforce.one.navigateToURL.  WORKS LIKE A CHARM!!! THanks

VFPAGE
<apex:page standardController="Account" extensions="MyControllerEXT" >
 

 <button onclick="javascript:sforce.one.navigateToURL('/apex/NxtPG?passInvoice=101');">GO</button>
</apex:page>

CONTROLER
global with sharing class MyControllerEXT{
public String passedNumber{get; set;}
public MyControllerEXT(ApexPages.StandardController Account){
        
	    }
	public String getPassNumber(){
	   return passedNumber = ApexPages.currentPage().getParameters().get('passInvoice');
	    }
	}