You need to sign in to do that
Don't have an account?

Query Community portal User that belongs to an account as a contact
Community portal user belongs to an account in Salesforce as a contact. how do I query the account name of the contact which is a user in the community portal?
Thank,
Alex
All Answers
Try this
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
Thanks,
Alex
UserInfo.getUSerId() - return id of current logged user.
This query returned current logged user and you can determine account name using code below
And this property you can use on vf page.
Thanks,
Alex
This is what I have right now
controller:
APEX Page
I dont know why it doesnt return the name of the account, am I missing something?
Thank,
Alex
Yeah, this should work
"Do I need..."
No i create public property for account and contact Thanks,
Alex
Basically in portal user ContactId is a field which is related to a contact which is relatted to a account which is a portal /community account .
So if you know the user then you need to get the contactid From the user and then you can get the account .
What exactly your requirment is ,what you want to ? Hard coding any is is not best practice in SFDC .
Thanks
Manoj
I want to disable them first and then we can merge them.
This code disable the user, but i need to disable person account.