{"id":713,"date":"2021-01-18T18:19:10","date_gmt":"2021-01-18T18:19:10","guid":{"rendered":"http:\/\/morecpq.com\/?p=713"},"modified":"2021-01-18T18:24:21","modified_gmt":"2021-01-18T18:24:21","slug":"cpq-display-psl-assignees","status":"publish","type":"post","link":"https:\/\/morecpq.com\/index.php\/2021\/01\/18\/cpq-display-psl-assignees\/","title":{"rendered":"CPQ &#8211; Display PSL Assignees"},"content":{"rendered":"\n<p>If you haven&#8217;t noticed, Salesforce removed the &#8220;Manage Licenses&#8221; link from the CPQ Installed Package listing.  Here&#8217;s an easy Visualforce page that shows these license assignments.  The intention here is to enhance this page to allow for assigning\/unassigning licenses.<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Class<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public with sharing class CPQPSLAssignments {\n    public List&lt;PermissionSetLicenseAssign> CPQPSLRecords {get; set;}\n    public boolean hasCPQ {get; set;}\n    \n    public List&lt;PermissionSetLicenseAssign> AAPSLRecords {get; set;}\n    public boolean hasAA {get; set;}\n    \n    public CPQPSLAssignments() {\n        CPQPSLRecords = &#91;select Assignee.Id, Assignee.Name, PermissionSetLicense.MasterLabel from PermissionSetLicenseAssign where PermissionSetLicense.MasterLabel in ('Salesforce CPQ License')];\n        hasCPQ = CPQPSLRecords.size() > 0;\n        \n        AAPSLRecords = &#91;select Assignee.Id, Assignee.Name, PermissionSetLicense.MasterLabel from PermissionSetLicenseAssign where PermissionSetLicense.MasterLabel in ('Salesforce CPQ AA License')];\n        hasAA = AAPSLRecords.size() > 0;\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Visualforce Page<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"CPQPSLAssignments\">\n&lt;apex:pageBlock title=\"CPQ PSL Assignments\">\n  &lt;apex:pageBlockTable value=\"{!CPQPSLRecords}\" var=\"Record\" rendered=\"{!hasCPQ}\">\n   &lt;apex:column >\n    &lt;apex:facet name=\"header\">Actions&lt;\/apex:facet>\n       &lt;a href='\/udd\/Licensing\/assignPermissionSetLicense.apexp?userId={!Record.Assignee.Id}' target=\"_blank\">Edit&lt;\/a>\n   &lt;\/apex:column>\n   &lt;apex:column >\n    &lt;apex:facet name=\"header\">Account Name&lt;\/apex:facet>\n       &lt;a href='\/{!Record.Assignee.Id}?noredirect=1&amp;isUserEntityOverride=1' target=\"_blank\">&lt;apex:outputText value=\"{!Record.Assignee.Name}\"\/>&lt;\/a>\n   &lt;\/apex:column>\n  &lt;\/apex:pageBlockTable>\n&lt;\/apex:pageBlock>\n&lt;apex:pageBlock title=\"Advanced Approvals PSL Assignments\" rendered=\"{!hasAA}\">\n  &lt;apex:pageBlockTable value=\"{!AAPSLRecords}\" var=\"Record\">\n   &lt;apex:column >\n    &lt;apex:facet name=\"header\">Actions&lt;\/apex:facet>\n       &lt;a href='\/udd\/Licensing\/assignPermissionSetLicense.apexp?userId={!Record.Assignee.Id}' target=\"_blank\">Edit&lt;\/a>\n   &lt;\/apex:column>\n   &lt;apex:column >\n    &lt;apex:facet name=\"header\">Account Name&lt;\/apex:facet>\n       &lt;a href='\/{!Record.Assignee.Id}?noredirect=1&amp;isUserEntityOverride=1' target=\"_blank\">&lt;apex:outputText value=\"{!Record.Assignee.Name}\"\/>&lt;\/a>\n   &lt;\/apex:column>\n  &lt;\/apex:pageBlockTable>\n&lt;\/apex:pageBlock>\n&lt;\/apex:page><\/code><\/pre>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/help.salesforce.com\/articleView?id=000355352&amp;type=1&amp;mode=1\" target=\"_blank\">Reference<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you haven&#8217;t noticed, Salesforce removed the &#8220;Manage Licenses&#8221; link from the CPQ Installed Package listing. Here&#8217;s an easy Visualforce page that shows these license assignments. The intention here is to enhance this page to allow for assigning\/unassigning licenses. Class Visualforce Page Reference<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-713","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/comments?post=713"}],"version-history":[{"count":4,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/713\/revisions"}],"predecessor-version":[{"id":717,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/posts\/713\/revisions\/717"}],"wp:attachment":[{"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/media?parent=713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/categories?post=713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/morecpq.com\/index.php\/wp-json\/wp\/v2\/tags?post=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}