• Summer Tucker
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
All - I created a wizard in visual force on a page called opptyStep1. I then assigned this page as the homepage on my site. 
Here's the issue: the preview screen of the page looks perfect but when I click on the site, two of the fields are not showing correctly: one is supposed to be a dropdown menu (Investment Strategy), the other a checkbox (active__c). The check box doesnt even show.  Any ideas?  The code is below

<apex:page sidebar="false" standardstylesheets="false" showheader="false" controller="newOpportunityController"
           tabStyle="Opportunity">
           <apex:image value="http://i723.photobucket.com/albums/ww231/sumtuck1/la-investments-v2-intrlcd-nav_zpsumlix1ia.png"/>
 <apex:sectionHeader title="Step 1 of 3: Personal Information"
                     />
  <apex:form >
    <apex:pageBlock title="Open a NSRi Account">

      <!-- This facet tag defines the "Next" button that appears
           in the footer of the pageBlock. It calls the step2()
           controller method, which returns a pageReference to
           the next step of the wizard. -->  
    
      <apex:facet name="footer">
        <apex:commandButton action="{!step2}" value="Next"
                            styleClass="btn"/>
      </apex:facet>
    

      <!-- <apex:panelGrid> tags organize data in the same way as
            a table. It places all child elements in successive cells,
            in left-to-right, top-to-bottom order -->  
    
      <!-- <apex:outputLabel > and <apex:inputField > tags can be
            bound together with the for and id attribute values,
            respectively. -->  
    
      
     
    
       <apex:panelGrid columns="2">
         <apex:outputLabel value="First Name"
                           for="contactFirstName"/>
         <apex:inputField id="contactFirstName"
                          value="{!contact.firstName}"/>
         <apex:outputLabel value="Last Name" for="contactLastName"/>
         <apex:inputField id="contactLastName"
                          value="{!contact.lastName}"/>
         <apex:outputLabel value="Phone" for="contactPhone"/>
         <apex:inputField id="contactPhone"
                          value="{!contact.phone}"/>
           <apex:outputLabel value="Email"
                           for="accountPersonEmail"/>
          <apex:inputField id="accountPersonEmail"
                          value="{!account.personEmail}"/>
         <apex:outputLabel value="Date of Birth"
                           for="contactBirthdate"/>
          <apex:inputField id="contactBirthdate"
                          value="{!contact.birthdate}"/>
          <apex:outputLabel value="Social Security Number"
                           for="contactSocial_Security_Tax_ID__c"/>
          <apex:inputField id="contactSocial_Security_Tax_ID__c"
                          value="{!contact.Social_Security_Tax_ID__c}"/>
                           <apex:outputLabel value="Investment Strategy"
                            for="opportunityInvestment_Strategy__c"/>
          <apex:inputField id="opportunityInvestment_Strategy__c"
                           value="{!opportunity.Investment_Strategy__c}"/>
          <apex:outputLabel value="Initial Investment Amount"
                            for="opportunityAmount"/>
          <apex:inputField id="opportunityAmount"
                           value="{!opportunity.amount}"/>
          <apex:outputLabel value=""
                            for="opportunityActive__c"/>
          <apex:inputField id="opportunityActive__c"
                           value="{!opportunity.Active__c}"/>
                         
        
       </apex:panelGrid>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>
 
Hi All!  I am hoping you can help.  I created an apex class called newOpportunityController in my sandbox and when I tested it, everything worked fine. I then deployed it to my production environment and when I try to validate it get errors.  See  below for the code as well as the errors.  Any advice is greatly appreciated!

ERRORS RECEIVED: 
0 0 HomePageController.t1(), Details: System.NullPointerException: Attempt to de-reference a null object Class.HomePageController.t1: line 69, column 1
0 0 CMSForceSetupController.t1(), Details: System.AssertException: Assertion Failed: Expected: https://na1.salesforce.com/, Actual: https://na1.salesforce.com Class.CMSForceSetupController.t1: line 102, column 1

CODE USED:

public class newOpportunityController {

   // These four member variables maintain the state of the wizard.
   // When users enter data into the wizard, their input is stored
   // in these variables. 
   Account account;
   Contact contact;
   Opportunity opportunity;
   OpportunityContactRole role;


   // The next four methods return one of each of the four member
   // variables. If this is the first time the method is called,
   // it creates an empty record for the variable.
   public Account getAccount() {
      if(account == null) account = new Account();
      return account;
   }

   public Contact getContact() {
      if(contact == null) contact = new Contact();
      return contact;
   }

   public Opportunity getOpportunity() {
      if(opportunity == null) opportunity = new Opportunity();
      return opportunity;
   }

   public OpportunityContactRole getRole() {
      if(role == null) role = new OpportunityContactRole();
      return role;
   }


   // The next three methods control navigation through
   // the wizard. Each returns a PageReference for one of the three pages
   // in the wizard. Note that the redirect attribute does not need to
   // be set on the PageReference because the URL does not need to change
   // when users move from page to page.
   public PageReference step1() {
      return Page.opptyStep1;
   }

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

   public PageReference step3() {
      return Page.opptyStep3;
   }


   // This method cancels the wizard, and returns the user to the 
   // Opportunities tab
    public PageReference cancel() {
            PageReference opportunityPage = new ApexPages.StandardController(opportunity).view();
            opportunityPage.setRedirect(true);
            return opportunityPage; 
    }

   // This method performs the final save for all four objects, and
   // then navigates the user to the detail page for the new
   // opportunity.
   public PageReference save() {

      // Create the account. Before inserting, copy the contact's
      // phone number into the account phone number field.
      account.phone = contact.phone;
      insert account;

      // Create the contact. Before inserting, use the id field
      // that's created once the account is inserted to create
      // the relationship between the contact and the account.
      contact.accountId = account.id;
      insert contact;

      // Create the opportunity. Before inserting, create 
      // another relationship with the account.
      opportunity.accountId = account.id;
      insert opportunity;

      // Create the junction contact role between the opportunity
      // and the contact.
      role.opportunityId = opportunity.id;
      role.contactId = contact.id;
      insert role;

      // Finally, send the user to the detail page for 
      // the new opportunity.


      PageReference opptyPage = new ApexPages.StandardController(opportunity).view();
      opptyPage.setRedirect(true);

      return opptyPage;
   }

}


 
I created a page and then added the page as the homepage on my site in Salesforce. When I click the link to the site, I get the message that says "authorization required: you must first log in or register.." How do I set the page to be viewed publicly so all can see it without logging in?

Thanks!
Summer
Hi All!  I am following this tutorial and do not understand step 4.  I follow the entire step and do not see a "create apex controller newOpporutunityController" option.

http://developer.force.com/cookbook/recipe/creating-a-wizard-with-visualforce-pages

Please help!
All - I created a wizard in visual force on a page called opptyStep1. I then assigned this page as the homepage on my site. 
Here's the issue: the preview screen of the page looks perfect but when I click on the site, two of the fields are not showing correctly: one is supposed to be a dropdown menu (Investment Strategy), the other a checkbox (active__c). The check box doesnt even show.  Any ideas?  The code is below

<apex:page sidebar="false" standardstylesheets="false" showheader="false" controller="newOpportunityController"
           tabStyle="Opportunity">
           <apex:image value="http://i723.photobucket.com/albums/ww231/sumtuck1/la-investments-v2-intrlcd-nav_zpsumlix1ia.png"/>
 <apex:sectionHeader title="Step 1 of 3: Personal Information"
                     />
  <apex:form >
    <apex:pageBlock title="Open a NSRi Account">

      <!-- This facet tag defines the "Next" button that appears
           in the footer of the pageBlock. It calls the step2()
           controller method, which returns a pageReference to
           the next step of the wizard. -->  
    
      <apex:facet name="footer">
        <apex:commandButton action="{!step2}" value="Next"
                            styleClass="btn"/>
      </apex:facet>
    

      <!-- <apex:panelGrid> tags organize data in the same way as
            a table. It places all child elements in successive cells,
            in left-to-right, top-to-bottom order -->  
    
      <!-- <apex:outputLabel > and <apex:inputField > tags can be
            bound together with the for and id attribute values,
            respectively. -->  
    
      
     
    
       <apex:panelGrid columns="2">
         <apex:outputLabel value="First Name"
                           for="contactFirstName"/>
         <apex:inputField id="contactFirstName"
                          value="{!contact.firstName}"/>
         <apex:outputLabel value="Last Name" for="contactLastName"/>
         <apex:inputField id="contactLastName"
                          value="{!contact.lastName}"/>
         <apex:outputLabel value="Phone" for="contactPhone"/>
         <apex:inputField id="contactPhone"
                          value="{!contact.phone}"/>
           <apex:outputLabel value="Email"
                           for="accountPersonEmail"/>
          <apex:inputField id="accountPersonEmail"
                          value="{!account.personEmail}"/>
         <apex:outputLabel value="Date of Birth"
                           for="contactBirthdate"/>
          <apex:inputField id="contactBirthdate"
                          value="{!contact.birthdate}"/>
          <apex:outputLabel value="Social Security Number"
                           for="contactSocial_Security_Tax_ID__c"/>
          <apex:inputField id="contactSocial_Security_Tax_ID__c"
                          value="{!contact.Social_Security_Tax_ID__c}"/>
                           <apex:outputLabel value="Investment Strategy"
                            for="opportunityInvestment_Strategy__c"/>
          <apex:inputField id="opportunityInvestment_Strategy__c"
                           value="{!opportunity.Investment_Strategy__c}"/>
          <apex:outputLabel value="Initial Investment Amount"
                            for="opportunityAmount"/>
          <apex:inputField id="opportunityAmount"
                           value="{!opportunity.amount}"/>
          <apex:outputLabel value=""
                            for="opportunityActive__c"/>
          <apex:inputField id="opportunityActive__c"
                           value="{!opportunity.Active__c}"/>
                         
        
       </apex:panelGrid>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>
 
Hi All!  I am following this tutorial and do not understand step 4.  I follow the entire step and do not see a "create apex controller newOpporutunityController" option.

http://developer.force.com/cookbook/recipe/creating-a-wizard-with-visualforce-pages

Please help!