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
Matt_FMatt_F 

Show tab on Visualforce page based on IsCurrentUserlicensed

I am trying to use the following code to show a tab on my Visualforce page only if the current user has a license for Apttus, but for some reason, when the code is in place, no records show in the tab.

<apex:tab label="Associated Agreements" name="Agreements" id="tabAgreements">

          <apex:relatedList subject="{!opportunity}" list="Apttus__R00N50000001Xl0FEAS__r" rendered="{$UserInfo.isCurrentUserLicensed('Apttus')}" />

      </apex:tab>

 Any help you can provide would be greatly appreciated 
Thanks.


 
pconpcon
I would try to move the logic to the controller
 
<apex:relatedList subject="{!opportunity}" list="Apttus__R00N50000001Xl0FEAS__r" rendered="{!isApttusUser}" />
 
public Boolean isApttusUser() {
    return UserInfo.isCurrentUserLicensed('Apttus');
}
Matt_FMatt_F
I am getting an error "Unknown Property 'AccountStandardController.isApttusUser'".  Any thoughts as to why?
pconpcon
That's my fault.  The code should be this

Visual Force
<apex:relatedList subject="{!opportunity}" list="Apttus__R00N50000001Xl0FEAS__r" rendered="{!isApttusUser}" />

Controller
public Boolean getIsApttusUser() {
    return UserInfo.isCurrentUserLicensed('Apttus');
}