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?

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .