how many licenses I have?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
hi,

I have licenses for internal users and licenses for portal users, but in the manage licenses there's only 1 count of licences:
Allowed Licenses 32
Used Licenses 26

I know that I have 22 internal user licences and 10 portal.

Now is easy to track because numbers are low and I can count how many users, but in the future...
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
So is your question, "How can I track how many Licenses I have assigned to Portal Users versus how many are assigned to Internal Users?"

Here is the XML for a page that should help with that. (Note: this page must be run by a System Administrator in order to be useful). It uses an Aggregate Model on the User object with a Result of Subquery condition on the UserPackageLicense object, grouped by the User's Profile's User License type. It will give a Table with results like this:



<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="true">   
  <models>
      <model id="Users" limit="" query="true" createrowifnonefound="false" adapter="" type="aggregate" sobject="User" orderby="COUNT(Id) DESC">
         <fields>
            <field id="Id" name="countId" function="COUNT"/>
         </fields>
         <conditions>
            <condition type="join" value="" field="Id" operator="in" enclosevalueinquotes="true" joinobject="UserPackageLicense" joinfield="UserId">
               <conditions>
                  <condition type="fieldvalue" value="skuid" enclosevalueinquotes="true" field="PackageLicense.NamespacePrefix"/>
               </conditions>
            </condition>
         </conditions>
         <actions/>
         <groupby method="simple">
            <field id="Profile.UserLicense.Name" name="profileUserLicenseName"/>
         </groupby>
      </model>
   </models>
   <components>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="false" model="Users" buttonposition="" mode="readonly" uniqueid="sk-2fpHr5-152">
         <fields>
            <field id="Profile.UserLicense.Name" name="profileUserLicenseName" valuehalign="" type="" allowordering="true">
               <label>User License Name</label>
            </field>
            <field id="Id" name="countId" valuehalign="" type="" allowordering="true">
               <label># of Licenses</label>
            </field>
         </fields>
         <rowactions/>
         <massactions usefirstitemasdefault="true"/>
         <views>
            <view type="standard"/>
         </views>
      </skootable>
   </components>
   <resources>
      <labels/>
      <javascript/>
      <css/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb
Thanks! and a way to know how many remaining licenses I have of every type? 
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
Unfortunately no, not out of the box, we can't currently provide that level of information via a query on any Salesforce objects --- you can query on the PackageLicense object (with a Condition on the NamespacePrefix field setting equal to "skuid") to know how many total remaining Skuid licenses you have, but there's no way to break this down by license type. \

However, you could add a Custom Object or Custom Setting to your org for you to internally keep track of that information. Call it "Skuid License Info" or something, and then have a field on it called "License Type" that's a picklist or something with values like "Salesforce", "Customer Community", etc. (matching the License Names for Salesforce license types), as well as a "Licenses Remaining" field. Then you could use a Skuid page (maybe with some Ui-Only Fields and the MODEL_LOOKUP() function) to go lookup the number of licenses remaining for each type to display it alongside the number of licenses used.