Take the 2-minute tour ×
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.

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
add comment

1 Answer 1

up vote 1 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
add comment

Your Answer

 
discard

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.