• BogdanS
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello all,
 
I'm very new at SalesForce and I have read through most of the documentation and developed the Mileage application from the workbook, but I'm still struggling with what should be a simple task.
 
Here is the scenario in a nutshell:
I am developing a custom application that a corporate team will use to provide feedback to new SalesForce users about how they are using the SalesForce platform.
 
Below is the VisualForce page the corporate team will see to submit new feedback. Obviously not finished, but this is the basic idea: select a SFDC user from the {!Users} object, enter the URL of the page in question, and create a message.
 
How does one pull in the data from the Users object and use it in the selectList? In a standard SalesForce form, related fields open a dialogue where you can either select or search for users. Is there any way to call that functionality from your VisualForce page?
 
 
Code:
<apex:page standardController="Feedback__c">

<h1>Provide Feedback</h1>
  
  <apex:form >
  
                <apex:pageBlock title="Enter New Feedback" mode="insert">
                       <apex:pageBlockButtons >
                       <apex:commandButton action="{!save}" value="Save"/>

                       </apex:pageBlockButtons>
                       <apex:pageBlockSection title="Feedback Details" columns="2">              
                       <apex:selectList value="{????}"/>   
                       <apex:inputField value="{!Feedback__c.URL__c}"/>
                       <apex:inputField value="{!Feedback__c.Details__c}"/>
                                
                                
                        </apex:pageBlockSection>
                </apex:pageBlock>
        </apex:form>

 
I understand that methods can be written in your controller class that may be able to accomplish this task, but this brings me to my second very newbie question: Why when I create a custom controller does my {!save} method no longer work?

I found this very helpful code below, but I can't seem to use it because I lose all functionality when I switch away from the standardController and use a custom controller class instead.

Code:
public class NewFeedbackController {
 
public String selectedUser {get;set;}
   public List<SelectOption> userList;
   public List<SelectOption> getUsers() { 
     if (userList == null) {
          List<User> usrs = [select id,firstname,lastname from user];
              userList = new List<SelectOption>();    
              for (User u : usrs) {     
                userList.add(new SelectOption(u.id, u.firstname + u.lastname));  
           }
    }
                      
     return userList;
                      
    
    }

}

Thanks in advance for your assistance!

Chris


I have one VF page and a  controller having a method fatching records using third party API and putting records into a map. in VF page m calling this method as action method and map to display records. this VF page is having a output link transferring control to 2nd VF page.  In  2nd  VF page i wanna to use  same map to display same records and dont want to call the method again cos of method's execution time. my question is how to achieve this because VF provides a way to pass parameters but ther is no way to set attributes like setAttributes for jsp/servlet in java.