You need to sign in to do that
Don't have an account?
Mubarak
How to get the child Records
Hi all.
How to get child records of particular record.
I am having one search bar ,if i enter any record and click getChildRecord,it will display the child records of only the particular records.
VFPages...
<apex:page StandardController="Account" extensions="getchildRecords">
<apex:form >
<apex:pageBlock title="Child Records of Account">
Enter Account Name:
<apex:inputText value="{!SearchString}" /><br></br><br></br>
<apex:CommandButton value="Get Child Records" action="{!GetChildRecords}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Class...
public class getchildRecords {
Public string SearchString {get;set;}
Public List<Account> acc{get;set;}
public getchildRecords(ApexPages.StandardController controller) {
}
Public void GetchildRecords(){
SearchString=[Select Name,(Select Name,Email from Contacts) from Account limit 2];
acc=Database.Query(SearchString);
}
}
Here I want to get the child records for Account Records.
How to achieve this.
Thanks
How to get child records of particular record.
I am having one search bar ,if i enter any record and click getChildRecord,it will display the child records of only the particular records.
VFPages...
<apex:page StandardController="Account" extensions="getchildRecords">
<apex:form >
<apex:pageBlock title="Child Records of Account">
Enter Account Name:
<apex:inputText value="{!SearchString}" /><br></br><br></br>
<apex:CommandButton value="Get Child Records" action="{!GetChildRecords}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Class...
public class getchildRecords {
Public string SearchString {get;set;}
Public List<Account> acc{get;set;}
public getchildRecords(ApexPages.StandardController controller) {
}
Public void GetchildRecords(){
SearchString=[Select Name,(Select Name,Email from Contacts) from Account limit 2];
acc=Database.Query(SearchString);
}
}
Here I want to get the child records for Account Records.
How to achieve this.
Thanks
You should have a searchbox for search. on search show all the matching accounts in table below searchbox.
Have a link or button for each account record, on click of which display all the related contact records below Accounts.
Let us know if you face any problems with implementation.
If you want to do custom search then please try below blog code :-
http://amitsalesforce.blogspot.in/search/label/Pagination
Please let us know if this will help you.
Thanks for ur reply.
Its not working.But i tried with some other way and now its working.