ERROR: QUERY_TOO_COMPLICATED in the log file
Issue
This error occurs when the length of the SOQL statement is too long and fetches a large number of fields. In other words, the query may be too long or complex.
Background
Salesforce has a set limit on the length of a query to ensure the system runs smoothly for all customers. When a query is too long and fetches a large number of fields, the user may hit this limit. Some reasons for this error have to do with the way Salesforce processes queries.
Pulsar is a mobile app that uses the out-of-the-box API published by Salesforce. This means Pulsar is subject to the limits that Salesforce has placed on queries. Pulsar must also request each field by name, and not use shortcuts (such as * ) to request all fields from an object, which results in longer queries.
Solution
It is best to reduce the complexity of queries. Either reduce the length (characters) of the query or the number of fields it returns.
Another way to reduce the query complexity is to reduce the number of fields contained in an object. Salesforce suggests creating related objects to keep the complexity low.
For more information on this topic, refer to Salesforce Documentation - Maximum length for SOQL statements.
Â