2

We had a list view of the current user's records. However, to tell whether the record is the user's, it is not defined by the owner field, instead, it is defined by a custom field.

So originally, our org has the below formula field to resolve this issue:

IF
(AND(Ida_Typist_Assigned__r.FirstName = $User.FirstName,
Ida_Typist_Assigned__r.LastName = $User.LastName),
"Yes","No")

However, one of my users has reported timeout issue for this listview this morning. I am assuming this is caused by the filter based on this formula field - because it needs to calculate the value for the records.

Is there a way I can optimise this list view filter?

0

I think this is give you optimized one as you do not need to use lookup relationship to get the name.

IF(Ida_Typist_Assigned__c = $User.Id,"Yes","No")
  1. You can also contact with Salesforce to create custom index on formula field if this is deterministic.

Here are examples of common non-deterministic formulas. Force.com cannot index fields that:

  • Reference other entities (i.e., fields accessible through lookup fields)
  • Include other formula fields that span over other entities
  • Use dynamic date and time functions (e.g., TODAY, NOW)

A formula is also considered non-deterministic when it includes:

  • Owner, autonumber, divisions, or audit fields (except for CreatedDate and CreatedByID fields)

References to fields that Force.com cannot index

  • Multi-select picklists
  • Currency fields in a multicurrency organization
  • Long text area fields
  • Binary fields (blob, file, or encrypted text)

    Standard fields with special functionalities

  • Opportunity: Amount, TotalOpportunityQuantity, ExpectedRevenue, IsClosed, IsWon
  • Case: ClosedDate, IsClosed
  • Product: Product Family, IsActive, IsArchived
  • Solution: Status
  • Lead: Status
  • Activity: Subject, TaskStatus, TaskPriority

Refer Force.com Formula Fields, Indexes, and Performance Gotchas

  1. You can also look for options to use Skinny table if list view is performing slow.

Refer Skinny Tables

Salesforce creates skinny tables to contain frequently used fields and to avoid joins, and it keeps the skinny tables in sync with their source tables when the source tables are modified. To enable skinny tables, contact Salesforce Customer Support.

For each object table, Salesforce maintains other, separate tables at the database level for standard and custom fields. This separation ordinarily necessitates a join when a query contains both kinds of fields. A skinny table contains both kinds of fields and does not include soft-deleted records.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.