You need to sign in to do that
Don't have an account?
Amr Mohsen
VF page doesn'r recognize cutom controller
Hello,
I've created apex class like below:
And VF page code is :
Why I get this error message ==>> "newTaskForTypeController does not exist" ??
I've created apex class like below:
public class newTaskForTypeController { TaskForTypes__c taskType; public TaskForTypes__c getTaskType(){ if(taskType == null) return new TaskForTypes__c(); return taskType; } //First page which will contain name public PageReference step1(){ return Page.Tasks_For_Types1; } //Second page which will contain Sub type name and public PageReference step2(){ return Page.Tasks_For_Types2; } //Cancel the operation public PageReference cancel(){ //Navigate to first page PageReference tft1 = new ApexPages.StandardController(taskType).view(); tft1.setRedirect(true); return tft1; } //Save method public PageReference save(){ insert taskType; PageReference tft1 = new ApexPages.StandardController(taskType).view(); tft1.setRedirect(true); return tft1; } }
And VF page code is :
<apex:page standardController="newTaskForTypeController" tabStyle="TaskForTypes__c" > <script> function confirmCancel() { var isCancel = confirm("Are you sure you wish to cancel?"); if (isCancel) return true; return false; } </script> <apex:sectionHeader title="Add New Task Assignment For Types Rule"/> <apex:form> <apex:pageBlock title="Rule Name" mode="edit"> <apex:pageBlockButtons> <apex:commandButton action="{!step2}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
Why I get this error message ==>> "newTaskForTypeController does not exist" ??
in page you are using standardcontroller attruibute, please chaneg it to controller only as per below code
Also change the controller class as below, as custom controller need to have a zero argumnet constructor. I kept this constructor as empty, if you need you can write some logic inside it too.
please let me know if you need any more assistance on this
All Answers
in page you are using standardcontroller attruibute, please chaneg it to controller only as per below code
Also change the controller class as below, as custom controller need to have a zero argumnet constructor. I kept this constructor as empty, if you need you can write some logic inside it too.
please let me know if you need any more assistance on this