i have to select Only Users which are community partner Users.How to select them ??what will be the SOQL query for selecting partner Users ?? which field in User profile will tell whether the user is community partner User or not ??

  • Partner Users would have the AccountId and ContactId set on them, unless you also have Customer Community Users, you can filter using where AccountId != null and ContactId != null – techtrekker Mar 4 '14 at 11:59

You can select by Profile name. Check which profile your community users have, and use that in your query.

[SELECT Id FROM User WHERE Profile.Name = 'Partner Community']
| improve this answer | |

Partner portal users also have access to Community So, it is better to filter a query by Community license:

This will return all users who have a profile with license of community.

List <User> communityUsers = [SELECT id, Name FROM User WHERE Profile.UserLicense.Name='Partner Community' OR Profile.UserLicense.Name='Customer Community'];
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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