You need to sign in to do that
Don't have an account?
Alena Semenova 14
Can you please tell me how to choose a particular field of the lookup which have questions? in each lookup there are questions (it's test app). the user selects a particular test and needs questions of the selected test. help :(
Clicking on a button and moving to a new page with questions: public PageReference runTest () { insert newSession; PageReference ref = new PageReference ('/apex/LaunchTests'); return ref; }
Controller:
public class LaunchTestsController { public List <Test_item__c> newItem { get; set;} public LaunchTestsController () { string str = 'SELECT Id, Question__c, Response__c, Response1__c, Responce2__c, Answer__c FROM Test_item__c'; this.newItem = Database.query(str); } }VF Page:
<apex:page controller="LaunchTestsController" > <apex:form > <apex:pageBlock title="Questions"> <apex:pageBlockTable value="{!newItem}" var="item"> <apex:column value="{!item.Question__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
Basically you will have to user apex:ActionSupport on your input lookup field to fetch the information of Selected lookup record.
See example
http://bobbuzzard.blogspot.com/2011/11/retrieve-related-object-fields.html