Loading
Salesforce now sends email only from verified domains. Read More
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          hasRole(role)

          hasRole(role)

          This function accepts a role name string and checks whether it is among the known roles of the current application user.

          Required Editions

          Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          Parameters

          The input parameter role is a string.

          Warning
          Warning This method is customizable. However, we neither recommend that you customize this method nor we support this feature.

          Sample Code

          var bHasRole = user.hasRole("MobileDSDDriver");
           
          Loading
          Salesforce Help | Article