Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to query the Customer and Partner Portal Roles. I was able to find the PartnerRole, UserRole objects but didn't find any CustomerRole one.

Are these the objects I need to query? How do I find out about the Customer Portal roles?

share|improve this question
up vote 2 down vote accepted

There isn't one. Customer Portal Roles (as well as Partner Roles) are stored in the UserRole object. The PartnerRole object is picklist definition object which defines the values for for AccountPartner.PartnerRole, much like OpportunityStage does for Opportunity.Stage.

To distinguish between regular, partner portal, and customer portal roles filter on the PortalType field. For example:

List<UserRole> standardUserRoles = [select id from UserRole where portalType = 'None'];
List<UserRole> customerPortalRoles = [select id from UserRole where portalType = 'CustomerPortal'
List<UserRole> partnerPortalRoles = [select id from UserRole where portalType = 'Partner'];

Also, as a general tip, if you're looking to familiarize yourself with the standard Salesforce object data model head straight to the Standard Objects section of the Web Services API Docs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.