Overview:
User is unable to sync. In the activity logs, the following error appears: Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions.
Root Cause:
Invalid Vmobile Object Configuration (VMOC) WHERE clause.
Solution:
When creating a custom WHERE clause on a VMOC record, the query clause initiates a Salesforce Object Query Language (SOQL) query. Sub-queries are supported as well. Double-embedded subqueries are not supported by SOQL so the sync fails.
Example:
WHERE (Call_Date_vod__c>=LAST_N_DAYS:30 AND Account_vod__c IN (SELECT Account_vod__c FROM TSF_vod__c WHERE Territory_vod__c in (@@VOD_MY_TERRITORY@@) AND (Custom_Checkbox__c = TRUE)))
This query fails because the sub-query is joined inside the parenthesis.
Example to resolve the error:
WHERE Call_Date_vod__c>=LAST_N_DAYS:30 AND Account_vod__c IN (SELECT Account_vod__c FROM TSF_vod__c WHERE Territory_vod__c in (@@VOD_MY_TERRITORY@@) AND (Custom_Checkbox__c = TRUE))
Related Documentation:
N/A
Thank you