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
YuckleYuckle 

$UserRole.PortalType

Where can I get a list of the possible values for $UserRole.PortalType?

 

or any other global variable/merge field for that matter.

 

Currently I'm trying to determine if a contact is a self service portal user.

Ispita_NavatarIspita_Navatar

The list of all the PortalType - which is a picklist in object UserRole,can be retrieved
by using the describe object, please check the enclosed code snippet:-
public List<SelectOption>  getPortalType()
{
  List<SelectOption> options = new List<SelectOption>();
        
   Schema.DescribeFieldResult fieldResult =
 User.PortalType.getDescribe();
   List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        
   for( Schema.PicklistEntry f : ple)
   {
      options.add(new SelectOption(f.getLabel(), f.getValue()));
   }       
   return options;
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.