Execute logic based on logged in Usertype Standard or Community Portal User



If we want to execute the logic particular to the Usertype we can use UserInfo.getUserType.There are different usertypes in salesforce.

1) Standard
2) PowerPartner
3) CSPLitePortal
4) CustomerSuccess
5) PowerCustomerSuccess
6) CsnOnly


if(UserInfo.getUserType()=='CspLitePortal' || UserInfo.getUserType()=='PowerCustomerSuccess' || UserInfo.getUserType()=='Standard'){
  // Logic
}

Reference : https://salesforce.stackexchange.com/questions/3889/what-are-the-possible-options-for-usertype

Comments

Post a Comment

Popular posts from this blog

Community/Experience Cloud Interview Questions

Script to delete multiple records using Apex salesforce

Change Owner / Update record using Lightning Custom Button Salesforce