You need to sign in to do that
Don't have an account?
render a part of the Account page based on the user being part of the Account team
Trying to do what the title says. Class:
VF Page:
Do not even get any queries rows on my debug logs. What's not firing? thanks!
public class AccountTeamChecker { private ApexPages.StandardController sc; public AccountTeamChecker(ApexPages.StandardController sc) { this.sc = sc; } // Returns true if the user is an account team member public Boolean renderELEMENT{ get { if (renderELEMENT== null) { renderELEMENT= [ select count() from AccountTeamMember where AccountId = :sc.getId() and UserId = :UserInfo.getUserId() and AccountAccessLevel in ('Read', 'Edit', 'All') ] > 0; } return renderELEMENT; } private set; } }
VF Page:
<apex:page standardController="Account" extensions="AccountTeamChecker" rendered="!renderELEMENT"> <apex:pageBlock title="Rendering"> RENDERED! </apex:pageBlock> </apex:page>
Do not even get any queries rows on my debug logs. What's not firing? thanks!
<apex:page standardController="Account" extensions="AccountTeamChecker" rendered="{!renderELEMENT}">
Hmm. Debug logs show select coutn returning 0 even though I am on the AccountTeam.
If I comment out this line:
It renders properly.
What other access could I have? I see ALL when I do a query for the Account share table. Is it b/c I am system admin?