You need to sign in to do that
Don't have an account?
chiruganta
How to get list of user licenses in apex to show on VF page
I need help on showing list of user licences in Visualforce Page. Is this possible? If yes, please send me the steps to follow.
Please find the snippet:
VF Page:
<apex:page controller="ListOFuserLicenses"> <apex:repeat value="{!ListOfUserLicences}" var="usl"> <apex:outputText value="{!usl}"/> <br/> </apex:repeat> </apex:page>
Class:
public class ListOFuserLicenses {
public List<String>getListOfUserLicences(){
List<string> Lt=new list<string>();
for(UserLicense a:[SELECT Name FROM UserLicense]){
lt.add(a.Name);
}
return lt;
}
}
All Answers
Please find the snippet:
VF Page:
<apex:page controller="ListOFuserLicenses"> <apex:repeat value="{!ListOfUserLicences}" var="usl"> <apex:outputText value="{!usl}"/> <br/> </apex:repeat> </apex:page>
Class:
public class ListOFuserLicenses {
public List<String>getListOfUserLicences(){
List<string> Lt=new list<string>();
for(UserLicense a:[SELECT Name FROM UserLicense]){
lt.add(a.Name);
}
return lt;
}
}
Have you found any approach for this question?
I am too trying to get the total count of used license and unused license in the org. not luck for so far.
Please let me know if there is any .