Hi everyone,
I'm having a multi layer nested CDT (Nested CDT that is a column in another nested CDT column of the main CDT that uses as data type) which is taking too long to query data and sometimes causes time out error. I would love to have some suggestion to optimise/ replace it with something else if possible.
Thank you
Discussion posts and replies are publicly visible
Deeper nesting can create an N+1 query problem and slow queries or timeouts.Create a DB view with the required JOINs and map it to a single flat CDT. Then query that view with one a!queryEntity() call, using paging and only the fields you need. For longer-term maintainability, consider Record Types with Relationships(Replace deep nested CDTs with flat related CDTs)