You need to sign in to do that
Don't have an account?
Ashu sharma 38
Account SOQL query
public class Apex_Account_search01 {
public list<Account> acclist {set;get;}
public string selected {set;get;}
public Apex_Account_search01(){
acclist=[select id,name,phone from Account ];
}
public void sumbit(){
string s=selected + '%';
string query='select id,name,phone from Account where name like :s';
acclist=Database.query(query);
}
}
<apex:page controller="Apex_Account_search01">
<apex:form >
<apex:inputText value="{!selected}">
<apex:commandButton action="{!sumbit}" value="sumbit"/>
</apex:inputText>
<apex:pageBlock >
<apex:pageBlockTable value="{!acclist}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
<apex:column value="{!a.id}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
My requirmentis that I want to make a page just like Account listView whenever i click on A all the records start with A...and B,C....and all like that
public list<Account> acclist {set;get;}
public string selected {set;get;}
public Apex_Account_search01(){
acclist=[select id,name,phone from Account ];
}
public void sumbit(){
string s=selected + '%';
string query='select id,name,phone from Account where name like :s';
acclist=Database.query(query);
}
}
<apex:page controller="Apex_Account_search01">
<apex:form >
<apex:inputText value="{!selected}">
<apex:commandButton action="{!sumbit}" value="sumbit"/>
</apex:inputText>
<apex:pageBlock >
<apex:pageBlockTable value="{!acclist}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
<apex:column value="{!a.id}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
My requirmentis that I want to make a page just like Account listView whenever i click on A all the records start with A...and B,C....and all like that
I have the code for you ,
Just try this one u will get the exact requirement.
Thanks & Regards
Srikanth
Salesforce Developer
Hi Nitish,
Please try the below code:
Thanks
Akshay
I am getting an duplicate error.
"duplicate value found: <unknown> duplicates value on record with id: <unknown>"
And kindly tell me i want to use this query as by using dynamic query.
Thank you for Your reply...
Try for this code
Without using the button.
// controller
Thanks.
Akshay