0

I am trying to Create Wizard for Custom Object

Here is my Apex Code:

public class Pageniation {
public FeedbackFrom__c Fed{get;set;}

 public FeedbackFrom__c getFed() {
      if(Fed== null) Fed = new FeedbackFrom__c();
      return Fed;
   }
    public PageReference step1() {
      return Page.Newtest;
   }

   public PageReference step2() {
      return Page.Newtest2;
   }

   public PageReference step3() {
      return Page.Newtest3;
   }
 public PageReference cancel() {
            PageReference FeedbackPage = new ApexPages.StandardController(Fed).view();
            FeedbackPage.setRedirect(true);
            return FeedbackPage; 
    }
public PageReference save() {

PageReference FeedbackPage = new ApexPages.StandardController(Fed).view();
      FeedbackPage.setRedirect(true);

      return FeedbackPage;
   }

}

Here is my VF Code:

<apex:page controller="Pageniation" tabStyle="FeedbackFrom__c">
  <script>
  function confirmCancel() {
      var isCancel = confirm("Are you sure you wish to cancel?");
      if (isCancel) return true;

     return false;
  }  
  </script>
  <apex:sectionHeader title="New Customer Opportunity" subtitle="Step 1 of 3"/>
    <apex:form>
      <apex:pageBlock title="Customer Information" mode="edit">
      <apex:pageBlockButtons>
          <apex:commandButton action="{!step2}" value="Next"/>
          <apex:commandButton action="{!cancel}" value="Cancel" 
                              onclick="return confirmCancel()" immediate="true"/>
        </apex:pageBlockButtons>
      <apex:pageBlockSection title="FeedBack">
     <apex:inputField id="myPicklist" required="true" value="{!FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c}"/><br /> <br /> 
              </apex:pageBlockSection>
       </apex:pageBlock>
  </apex:form>
</apex:page>

But am Getting Unknown property 'Pageniation.FeedbackFrom__c' error please help me out from this issue.

  • 3
    It's Fed not FeedbackFrom__c; – itzmukeshy7 Apr 11 '17 at 5:53
0

You can use instance references in the Visualforce page, not the object type.

So when you do <apex:inputField id="myPicklist" required="true" value="{!FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c}"/>, the visualforce page could not find any instance with name FeedbackFrom__c in the controller.

You have an instance named - fed which is of type FeedbackFrom__c, so you should use fed.X2_Are_you_Satisfied_with_our_production__c instead of FeedbackFrom__c.X2_Are_you_Satisfied_with_our_production__c.

What @itszmukeshy commented is correct, I just thought there should be an explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.