I need to be able to query the Contact's Parent Account and show it in apex page but I get an error for this. How do does it know that the person logged in parents to show . So right now in Partner Community there is a field called Parent ID which a user which is the contact has to click on it and then select its parent while making an account. I want to automatically assigned that to the user
public class newOpportunityController {
public List<Account> parentAccount { get; private set; }
public List<Account> parentAccount { get; private set; }
parentAccount = [SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contacts)
FROM Account ];
}