Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
do help me.
Thanks
You can Use <apex:relatedList list="Account" /> just need to provied the Id of the Account.
I think this will work.
Thanks and Regards
Niks
No this wont work,Account is not a related list of contact.
do reply for working solution.
Hi Alok,
You can query on Contact with Contact id and collect information of Account as well as Contact. since Account is in lookup relationship.
Like:
List<Contact> objCon = [Select Id, LastName, Account.Name, Account.Id from Contact where Id : ContactId];
Now in the page you can access objCon.Account.Name same like you do for objCon.LastName.
But rahul..
That i have to show thse details in visual force page...and contact id have to pass trough url
and corresponding to that contact .i need to display related account on same visual force page.
what could be d soultion..
Create a page with Standard controller as contact and define a extension for it.
In the Extension's constructor you will be getting the Id of the Contact which you are passing as parameter to your page.
Then query the information of contact and its parent account in Object in the constructor, as discussed in my earlier post.
and use that object in your visualforce page.
You can Use <apex:relatedList list="Account" /> just need to provied the Id of the Account.
I think this will work.
Thanks and Regards
Niks
No this wont work,Account is not a related list of contact.
do reply for working solution.
Hi Alok,
You can query on Contact with Contact id and collect information of Account as well as Contact. since Account is in lookup relationship.
Like:
List<Contact> objCon = [Select Id, LastName, Account.Name, Account.Id from Contact where Id : ContactId];
Now in the page you can access objCon.Account.Name same like you do for objCon.LastName.
But rahul..
That i have to show thse details in visual force page...and contact id have to pass trough url
and corresponding to that contact .i need to display related account on same visual force page.
what could be d soultion..
Create a page with Standard controller as contact and define a extension for it.
In the Extension's constructor you will be getting the Id of the Contact which you are passing as parameter to your page.
Then query the information of contact and its parent account in Object in the constructor, as discussed in my earlier post.
and use that object in your visualforce page.