You need to sign in to do that
Don't have an account?
error on defining custom action method in <commandButton> tag
Hi,
I am getting error like this : Unknown method 'Incident__cStandardController.SaveRecord()'
Below is my code:
*************************
Apex Page :
******************
<apex:page standardController="Incident__c" extensions="IncGetParmAdminClass" sidebar="false" showHeader="false">
.....
.....
.....
<apex:commandButton value="Submit" action='{!SaveRecord}'/>
Apex Class:
*******************
public class IncGetParmAdminClass
{
Public Incident__c param {get; set;}
private ApexPages.StandardController standard_Controller;
public IncGetParmAdminClass(ApexPages.StandardController standard_Controller)
{
param = new Incident__c();
.................
..................
public PageReference SaveRecord(){
insert param;
return null;
}
For some of my earlier requerement, I have done in the same way and it is working perfect. but for the above senario, I am getting error like this.
Am I doing any mistake on declaring custom action name inside standard controller page tag. Please help me out.
Thanks in advance.
SAKTI
I am getting error like this : Unknown method 'Incident__cStandardController.SaveRecord()'
Below is my code:
*************************
Apex Page :
******************
<apex:page standardController="Incident__c" extensions="IncGetParmAdminClass" sidebar="false" showHeader="false">
.....
.....
.....
<apex:commandButton value="Submit" action='{!SaveRecord}'/>
Apex Class:
*******************
public class IncGetParmAdminClass
{
Public Incident__c param {get; set;}
private ApexPages.StandardController standard_Controller;
public IncGetParmAdminClass(ApexPages.StandardController standard_Controller)
{
param = new Incident__c();
.................
..................
public PageReference SaveRecord(){
insert param;
return null;
}
For some of my earlier requerement, I have done in the same way and it is working perfect. but for the above senario, I am getting error like this.
Am I doing any mistake on declaring custom action name inside standard controller page tag. Please help me out.
Thanks in advance.
SAKTI
The issue that I was getting here for missing curly bracket "}" in my apex class.
Here I modified.
public class IncGetParmAdminClass
{
Public Incident__c param {get; set;}
private ApexPages.StandardController standard_Controller;
public IncGetParmAdminClass(ApexPages.StandardController standard_Controller)
{
param = new Incident__c();
.................
..................
} // Here I missed it.
public PageReference SaveRecord(){
insert param;
return null;
}
Thanks Again. Hope your support going forward. :)
-SAKTI
All Answers
Is incident__c is a controller? I am assuming that "IncGetParmAdminClass" is your custom controller.
Please try replacing the first line of apex page to the below and let me know if you face any issues: Thanks
Everything looks good, can u share all extension code?
Thanks,
Alex
The issue that I was getting here for missing curly bracket "}" in my apex class.
Here I modified.
public class IncGetParmAdminClass
{
Public Incident__c param {get; set;}
private ApexPages.StandardController standard_Controller;
public IncGetParmAdminClass(ApexPages.StandardController standard_Controller)
{
param = new Incident__c();
.................
..................
} // Here I missed it.
public PageReference SaveRecord(){
insert param;
return null;
}
Thanks Again. Hope your support going forward. :)
-SAKTI