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
mdsmds 

opportunity tab

 hey guyz

 

i want to add some custom fields to opportunity. The fields are of piclkist type n they get their value at run time through web servicecall...... how can i add such firelds to opportunity... any suggestions...plz help 

Best Answer chosen by Admin (Salesforce Developers) 
osamanosaman

If its a custom visualforce page, you can generate the picklist values for <apex:selectList> using SelectOption

 

<apex:SelectList value="{!myVal}">

    <apex:SelectOptions value="{!Options}"/>

</apex:SelectList>

 

public String myVal {get; set;}

public List<SelectOption> getOptions

{

   List<SelectOption> option = new List<SelectOption>();

option.add(new SelectOption('value', 'label');

   return option;

}

 

I hope this helps.

All Answers

osamanosaman

Go to Setup > App Setup > Customize > Opportunity > Fields.

 

Create new fields and select type as Picklist.

mdsmds

There options for picklist is mandatory..... n in our case the picklist is getting its value at runtime through web service call.. So options  are dynamic

osamanosaman

If its a custom visualforce page, you can generate the picklist values for <apex:selectList> using SelectOption

 

<apex:SelectList value="{!myVal}">

    <apex:SelectOptions value="{!Options}"/>

</apex:SelectList>

 

public String myVal {get; set;}

public List<SelectOption> getOptions

{

   List<SelectOption> option = new List<SelectOption>();

option.add(new SelectOption('value', 'label');

   return option;

}

 

I hope this helps.

This was selected as the best answer
mdsmds

thank u