function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mekingmeking 

Find all Salesforce CRM Content Users

Hello all, when adding a new user there is a checkbox for Salesfroce CRM Content User:



This checkbox gives the users permission to contribute documents to whichever library they have authoring privileges. We are running out of these licenses and we wanted to run a report to find all the users who have this checkbox checked.This field is not avialable as a filter in Salesforce Reports.

 

According to Salesforce documentation and other posts, this doesn't seem possible.

 

Anybody have any solutions or suggestions? We need to quickly access the 800 something users we have given this permission to so we can verfiy whether or not they actually need it. Thanks!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
EIE50EIE50

Hi,

 

A very quick workaround would be to export the data using data loader or to execute the query in eclipse ide.Use the below query for your any of the above (you can also include what ever fields you want to)

 

Select Id, FirstName, LastName, IsActive  From User where UserPermissionsSFContentUser=true

 

If you dont want to do this every other time, i would recommend you write a small code snippet which will return you a list of all the users with the content permissions in a VF page, below is the code snippet for this use case.

 

Apex Class:

 

public with sharing class ContentUsers {    
	Public List<User> getContentUsers(){       
		List<User> theCusers = [Select Id, FirstName, LastName, IsActive  From User where UserPermissionsSFContentUser=true];       
		return theCusers;      
	}
}

 VF Page: (you can include any number of columns as long as it is queried in the above class)

 

<apex:page controller="ContentUsers" readOnly="true" showHeader="false">
    <apex:dataTable value="{!ContentUsers}" var="a">
        <apex:column >
           <apex:outputLink value="{!a.FirstName}">{!a.FirstName} </apex:outputLink>
        </apex:column>
    </apex:dataTable>
</apex:page>

 The VF page is read only, so you will not be able to perform any DML operations here. The reason why it is ready only is to avoid the number of records returned governor limit (which normally is 50k), but with read only it is in millions.

 

Thanks.

 

All Answers

EIE50EIE50

Hi,

 

A very quick workaround would be to export the data using data loader or to execute the query in eclipse ide.Use the below query for your any of the above (you can also include what ever fields you want to)

 

Select Id, FirstName, LastName, IsActive  From User where UserPermissionsSFContentUser=true

 

If you dont want to do this every other time, i would recommend you write a small code snippet which will return you a list of all the users with the content permissions in a VF page, below is the code snippet for this use case.

 

Apex Class:

 

public with sharing class ContentUsers {    
	Public List<User> getContentUsers(){       
		List<User> theCusers = [Select Id, FirstName, LastName, IsActive  From User where UserPermissionsSFContentUser=true];       
		return theCusers;      
	}
}

 VF Page: (you can include any number of columns as long as it is queried in the above class)

 

<apex:page controller="ContentUsers" readOnly="true" showHeader="false">
    <apex:dataTable value="{!ContentUsers}" var="a">
        <apex:column >
           <apex:outputLink value="{!a.FirstName}">{!a.FirstName} </apex:outputLink>
        </apex:column>
    </apex:dataTable>
</apex:page>

 The VF page is read only, so you will not be able to perform any DML operations here. The reason why it is ready only is to avoid the number of records returned governor limit (which normally is 50k), but with read only it is in millions.

 

Thanks.

 

This was selected as the best answer
mekingmeking

Thanks so much for providing such an in depth solution. I tested both and both are great options.

 

Thanks!