deejay-hub / timeline-lwc

:octocat: An interactive timeline for the Salesforce platform.
https://dave-norris.medium.com/
MIT License
265 stars 72 forks source link

Apex error: SOQL statements cannot query more than 20 different child types. #246

Closed nduns closed 1 year ago

nduns commented 1 year ago

Time Warp version V1.11

Describe the bug I've added a new Custom Object to the Timeline to display on a Person Account. Had no issues adding Custom Objects in the past and have copied my steps taken previously (and refered to your instructions in Quip). Am getting an error message in the Timeline: "Apex error: SOQL statements cannot query more than 20 different child types."

To reproduce

  1. Configue new Timeline Configuration to display on Person Account
  2. Make Active
  3. Go to location in Person Account where Timeline is displayed to see the error message: "Apex error. SOQL statements cannot query more than 20 different child types."
  4. When I make the new configuration inactive, the timeline works as expected.

Expected behaviour Custom Object record expected to display on Timeline

Screenshots image image

Desktop (please complete the following information):

Additional context On top of the existing (standard) configurations provided in the package, I have 14 custom objects displaying on the Timeline for PersonAccounts.

github-actions[bot] commented 1 year ago

Hello @nduns , thank you for submitting an issue we appreciate your time. We will take a look and give you an update as soon as we can. We aim for a 72 hour response time.

nduns commented 1 year ago

Found this:

How many different types of related records can I plot?

We use sub queries to get the related records to your parent. Currently this has a limit of 20. So for a specific parent record you can include up to 20 related child record types.

deejay-hub commented 1 year ago

Hi @nduns . This limitation is in the docs as you found. We use relationship queries to support the metadata setup. This currently means we're bound by the limits Salesforce imposes. See the link below to the official docs.

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_query_limits.htm

When you design SOQL relationship queries, there are several limitations to consider. No more than 20 parent-to-child relationships can be specified in a query.

We love you're trying to plot more than 20 though! We don't plan on providing a work around to allow more since 20 since it creates other scale issues for us.

The only option is to inactivate one of the existing 20 records for Person Account to add your new config. So we encourage people to choose carefully.