You need to sign in to do that
Don't have an account?
I am not able to bring the fields of account object in Picklist
VF
<apex:page controller="search_global">
<apex:form >
<apex:pageBlock title="Custom Search" mode="edit" id="block" >
<apex:pageBlockSection >
<apex:inputCheckbox label="Limit to accounts I own" />
<apex:pageBlockSectionItem >
<apex:outputLabel for="SearchText">Enter The Records Of Accounts
</apex:outputLabel>
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>
<apex:commandButton value="Submit!" action="{!dosearch}" rerender="block" status="status"/>
</apex:panelGroup>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
<apex:pageBlockTable value="{!results}" var="l" rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!l.name}"/>
<apex:column value="{!l.industry}"/>
<apex:column value="{!l.rating}"/>
<apex:column value="{!l.AccountPriority__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
CONTROLLER
public class search_global {
String searchtext;
String newsearchtext=searchtext+'%';
List<account> Results;
public String getsearchtext(){
return searchtext;
}
public Boolean check{
get{
if(check== null){
check = false;
}
return check;
}
set;
}
public void setsearchtext(String s)
{
searchtext=s;
}
public list<account> getResults()
{
return Results;
}
public pagereference dosearch()
{
if(check==false)
{
results=[select name,Industry,Rating,AccountPriority__C from account where account.name like :searchtext+'%' or industry=:searchtext or rating=:searchtext or AccountRegion__c=:searchtext or AccountPriority__c=:searchtext or AccountSummary__c like :searchtext+'%'];
}
else
{
results=[select name,Industry,Rating,AccountPriority__C from account where (account.name like :searchtext+'%' or industry=:searchtext or rating=:searchtext or AccountRegion__c=:searchtext or AccountPriority__c=:searchtext or AccountSummary__c like :searchtext+'%')and (ownerid=:UserInfo.getUserId())];
}
return null;
}
}
//Upto this i got the entire fields of the record types.But my requirment is to give all those field of account record should be in a picklist.
Please find the code for creating multiselect picklist. Make the necessary changes.
Thank you sir.
Niladri Ghosh