You need to sign in to do that
Don't have an account?
Arvind010
Displaying a field in child object
In contact object there is a checkbox field 'primary program contact'. I want to display the contact name for which this checkbox field is checked
in the Account detail page. I'm using the following query to return the name of the contact. But i'm not able to find out the component tag to use in the page editor to display the contact name.
Any suggestion on this page will be really helpful.
in the Account detail page. I'm using the following query to return the name of the contact. But i'm not able to find out the component tag to use in the page editor to display the contact name.
Code:
public Account getcin(){ cin=[select(SELECT Name FROM Contacts where Primary_Contact_for_this_Company__c=true) FROM Account where OwnerId = :Userinfo.getUserId()]; return cin; }
Any suggestion on this page will be really helpful.
Those should all work
When i use this component tag, its showing the following error:
"Sobject row was retrieved without querying the requested field:name"
Since the actual field that your selecting on Account is contacts, you're going to get a list back. So you might want to limit the list to 1 (I assume that there will only be one primary contact for your account) but do something like this:
Does that make sense?
You can access cin.contacts since that what you selected directly from the account, but since that's a list, the only way to get at the names is to use an iterating component. Or to pull the contact out in your controller so you can access it directly.