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
SolidLucasSolidLucas 

query parameters

Hello! i want to do a query into a custom "Cia__c" field using the <apex:selectList>  well i've created a method like this

public List<SelectOption> getCiaOptions() {
        List<SelectOption> CiaOptions = new List<SelectOption>();
        CiaOptions.add(new SelectOption('','--Nenhum--'));
        CiaOptions.add(new SelectOption('a07o0000002Quf3AAC','Test1'));
        CiaOptions.add(new SelectOption('a07o0000002Quf8AAC','Test2'));
        return CiaOptions;
    }
}
   VisualForce!
<apex:selectList value="{!Cia}" multiselect="false" size="1" label="Cia">
                        <apex:selectOptions value="{!CiaOptions}" />
      </apex:selectList>


Someone could help me i've been trying but without success.

Thanks!

SarfarajSarfaraj
What it the problem you are facing?
SolidLucasSolidLucas
Well i want to to return the value of those two option in my picklist but is not returning nothing.
SarfarajSarfaraj
Are you referring to displaying the picklist in your page? If so this code is working as expected,
<apex:page controller="Cia">
<apex:form >
<apex:selectList value="{!Cia}" multiselect="false" size="1" label="Cia">
                        <apex:selectOptions value="{!CiaOptions}" />
      </apex:selectList>
      </apex:form>
</apex:page>
public with sharing class Cia {

    public String Cia { get; set; }
public List<SelectOption> getCiaOptions() {
        List<SelectOption> CiaOptions = new List<SelectOption>();
        CiaOptions.add(new SelectOption('','--Nenhum--'));
        CiaOptions.add(new SelectOption('a07o0000002Quf3AAC','Test1'));
        CiaOptions.add(new SelectOption('a07o0000002Quf8AAC','Test2'));
        return CiaOptions;
    }

}
Please let me know if you need anything else.

--Akram
SolidLucasSolidLucas
So Akram what i need is when i select the option the page returns the options selected what is not happening in my code, for example if i selecte the Test1 option i want the Test1 value returns  the same with the Test2. Those  parameters are into the Cia__c field. that is what i'm having trouble to do! thanks for your atention!
SarfarajSarfaraj
Can you please post some sample codes that you have written so far. Also if you post your object and field details, it will help me to give you proper solution.