function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MayankDkPantMayankDkPant 

Field Set + Apex Code

Hi,

 

I have created a Field Set for opportunity and added it to the visual force page.

Field set contains 4 picklist which are inter dependent.

 

Requirement: When user selects the piclist values in field set and click on search function, I want the to get piclist values in my apex code. Is there any way that I can retrieve the picklist value selected?

 

Any help wil be great.

 

With Regards,

Mayank Pant.

logontokartiklogontokartik

If I understood right, you have 4 picklist fields that are in the fieldset? and are you doing something like this?

 

<apex:repeat value="{!$ObjectType.Opportunity.FieldSets.OpportunityFieldSet}" var="fld"> 
          <apex:inputField value="{!opprec[fld]}"/>
</apex:repeat>

 

If so you can get the picklist value for each of the picklists from the opprec object. If you are using generic SOBject you can use opprec.get('picklistfieldname'). or if you are directly using opportunity you can do opprec.picklistfieldname and you will get the selected value. 

 

Please paste your code if you still dont understand the solution