+ Start a Discussion
micwamicwa 

Partner Portal --> Contact Id

Is there a way how to find out which contact the currently logged in user from a partner portal is? Something like a contactId on the user object or a partnerId field on the contact object?

Best Answer chosen by Admin (Salesforce Developers) 
micwamicwa

As I thought, there is a User.ContactId field but it wasn't shown in the eclipse schema.

All Answers

micwamicwa

As I thought, there is a User.ContactId field but it wasn't shown in the eclipse schema.

This was selected as the best answer
Pradeep_NavatarPradeep_Navatar

Try using SOQL Queries on Profile and User like this :

 

Profile p = [select name from profile where name = 'Partner staff Profile']

User usr = [Select id,ContactId, Profile.name from User where id=:UserInfo.getUserId()];

system.debug('-----Create Contact id of loggegedin user----'  + usr.contactid);

 

Hope this helps.