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

Community - VF page -Display Current Logged in User Accounts
Hi All,
I have created a VF page for community to add employee details. I have used a custom object (Employee) for which the master object is Account. I have also added the Account field on the VF page. Now i need to set the account value as the account of the logged in user[Community user Account). How can i achieve this?
<h5>Emergency Contact Information</h5>
<div class="form-field-row">
<div class="form-field-label">First Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_First_Name__c}" /></div>
</div>
<div class="form-field-row">
<div class="form-field-label">Last Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_Last_Name__c}" /></div>
</div>
<div class="form-field-row">
<div class="form-field-label">Last Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Account__c}" /></div>
</div>
I have created a VF page for community to add employee details. I have used a custom object (Employee) for which the master object is Account. I have also added the Account field on the VF page. Now i need to set the account value as the account of the logged in user[Community user Account). How can i achieve this?
<h5>Emergency Contact Information</h5>
<div class="form-field-row">
<div class="form-field-label">First Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_First_Name__c}" /></div>
</div>
<div class="form-field-row">
<div class="form-field-label">Last Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_Last_Name__c}" /></div>
</div>
<div class="form-field-row">
<div class="form-field-label">Last Name</div>
<div class="form-field-input"><apex:inputText value="{!Employee__c.Account__c}" /></div>
</div>
Accounts in salesforce are not related to users. Account means a company that we do business with. Its not something like a facebook account or gmail account
Hence the logged in user doesnt have an account linked with it.
You cant add a relationship like lookup or master from user to anything else.