Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Streamline Search Solutions and Reporting

Learning Objectives

After completing this unit, you’ll be able to:

  • Recognize anti-patterns related to Salesforce Object Search Language (SOSL) and reporting.
  • Understand the importance of the usage of roles within a hierarchy.

Scenario 2: Pinpointing Role Hierarchies and Reporting

A company recently purchased 100,000 Salesforce licenses. The company expects Salesforce to eventually replace its legacy systems. But for now, the company would like all of its data to remain mastered outside of Salesforce. The following is how the company has currently implemented its solution.

The company has a 15-level-deep org hierarchy. Since the company is going live with only a few business units in Salesforce to begin with, it doesn’t know which roles will be required in the future as the company goes live with additional business units. For this reason, the company replicated its entire org hierarchy to be reused for future needs.

The company has close to 200 million accounts in Salesforce. Each agent has access to all accounts that their respective agency services. But to ensure a seamless customer experience, the agents are required to service any customer who walks into the agency regardless of whether they are a prior customer. They have implemented a custom SOSL search solution for their agents to search for a given customer based on their name before creating a new account record. They noticed that this search returned no results most of the time, even when there was an existing customer record in Salesforce. This resulted in a lot of unnecessary duplicate records being created. To overcome this, they are now advising their agents to use global search instead of using the customer’s last name as a wildcard search.

To empower agents, the company opened up its reports and dashboards so that each agent can create their own reports. This started out well; the agents created close to 100,000 reports overall. However, the IT department has been receiving a lot of calls lately from agents complaining that their reports were timing out or taking a lot of time to execute.

Important Scenario Details

  • The company recently purchased 100,000 Salesforce licenses.
  • They have a 15-level-deep org hierarchy.
  • They have close to 200 million accounts.
  • They have implemented a custom SOSL search.

Things to Watch Out For

  1. Role realignment, if needed, will be an extremely expensive operation for large hierarchies.
  2. Custom SOSL search involves an overhead of implementation and maintenance.
  3. Reporting for users higher up in the hierarchy will be slow and ineffective.
  4. Allowing users to create a large number of reports and dashboards in their private folders can result in issues around deployments.
  5. Open report access can also result in numerous duplicate reports of the same nature being created.

Anti-Patterns

Anti-Pattern:Mimic org hierarchy for role hierarchy while creating temporary placeholder roles for the future. 

Best Practice: To improve performance, it’s best to limit the number of levels in your role hierarchy. Only create roles that meet your current requirements. It's important to know exactly how each role will be used. Also keep in mind that it’s not necessary for the org hierarchy to match the role hierarchy. Figure out how many sharing rules your org has. If there are a lot of sharing rules, this can mean that the role hierarchy is not performing well. For this reason, delete sharing rules that grant access to records already shared within the role hierarchy.

Anti-Pattern: Determine the max levels needed in Salesforce based on reporting needs. 

Best Practice: The number of records returned by a report is dependent on the sharing model. This in turn will directly impact performance.

Anti-Pattern:Use SOSL to implement custom search solutions by using global search with wildcards for large orgs. 

Best Practice: To improve performance when using SOSL, avoid wildcards and make sure that the search terms are very specific. The more data searched, the more the query will slow down execution.

Anti-Pattern:Use reports without any proper filters in place. 

Best Practice: Use filters and scope more efficiently so that less data is queried when running reports and the data can be returned faster. It’s vital to educate users on how to build efficient reports that can scale with company growth.

Anti-Pattern:Scope reports with date filters and indexed fields, if possible. 

Best Practice: Use date filters and indexed fields where possible instead of formula fields. Use relative date values like "this week", "next week", or "next month". Use "equals" instead of "contains" because "contains" performs a wildcard search. It's best to avoid using "not contains" and "not equals".

Anti-Pattern:Use canned reports for common operations. 

Best Practice: Start the governance process as soon as possible for consistency and ease of maintenance. Segment users into groups for certain analytics requirements and use cases, then create canned reports for each user group using filter best practices.

Having the tools to quickly pinpoint where integrations can go awry will make you an asset on your team. Fully understanding the boundaries and limitations to be able to scale appropriately lessens the amount of time spent on resolving anti-patterns related to bulkification, governance, locking, and post processing. 

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback