function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cpocpo 

Calling Account details from within the customer portal

Hi All,

 

I am having real trouble with something very simple. I am trying to grab the account details of a contact from within the portal but can't seem to do it.

Any help would be much appreciated. This is my Apex Class so far.

 

public class communityUserObj {

    public Contact contact {get; private set;}

    public communityUserObj() {
        contact = [SELECT Id, Name, Email, AccountId, Account.Package__c from contact where contact.Id IN (select user.ContactId from user where user.id = :UserInfo.getUserID())];        
    }
  
}

Duncan_IdahoDuncan_Idaho

try...

 

 

    public communityUserObj() {
        contact = [SELECT Id, Name, Email, AccountId, Account.Package__c FROM Contact where Id IN (SELECT ContactId FROM User WHERE id = :UserInfo.getUserID())];        
    }