You need to sign in to do that
Don't have an account?
Iswarya Sekar
on selecting a field from dropdown, i need to enter a value for that using VF and controller
<apex:page extensions="updateoppclass2" standardController="Opportunity"> <apex:form > <apex:pageblock title="Step 2 - select the field to be updated"> <span>Fields: </span> <apex:selectList multiselect="false" size="1"> <apex:selectOptions value="{!OppNames}"> </apex:selectOptions> </apex:selectList> <apex:pageblockbuttons > <apex:commandButton value="previous" action="{!gotopage1}"/> <apex:commandButton value="Next" action="{!gotostep3}"/> <apex:commandButton value="Cancel"/> </apex:pageblockbuttons> </apex:pageblock> </apex:form> </apex:page>
public with sharing class updateoppclass2 { public updateoppclass2(ApexPages.Standardcontroller controller){ } public PageReference gotopage1(){ PageReference pref2=New PageReference('/apex/oppupdatepage'); pref2.setRedirect(True); return pref2; } public PageReference gotostep3(){ PageReference pref3=New PageReference('/apex/entervalues'); pref3.setRedirect(True); return pref3; } public PageReference gotoVF(){ PageReference pref4=New PageReference('/apex/confmationpage'); pref4.setRedirect(True); return pref4; } public List<selectOption> oppflds; public updateoppclass2(){} public List<selectOption> getOppNames() { oppflds = new List<selectOption>(); oppflds.add(new selectOption('--none--','--none--')); Schema.DescribeSObjectResult opp_desc = Opportunity.sObjectType.getDescribe(); Map<String, Schema.SObjectField> opp_fields = opp_desc.fields.getMap(); for(Schema.sObjectField fld:opp_fields.values()) { String oppfldName = String.valueOf(fld); oppflds.add(new selectOption(oppfldName,oppfldName)); } System.debug('stdObjectNames: ' + oppflds); return oppflds; } }