function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Getting Error System.QueryException: unexpected token: '.' in dynamic query

I am getting error while running the page.

First time when i run the page it is working perfect, but when i am running next time(Record more then 11) getting this error:

Here is code which i wrote:

String accSizeInInteger='select id,name,OwnerId,RepCode__r.Name,Tax_ID_Type__c,Tax_ID__c from Account where RepCode__c= \''+repblast.Current_Rep__c+'\'' ;
            accSizeInInteger+=' and name like \'%'+ClientName+'%\'';
            accSizeInInteger+=' and Tax_ID_Type__c like \'%'+Type+'%\'';
            accSizeInInteger+=' and id not in '+doNotInclude;
        List<Account> accListSize=new List<Account>();


Please help any one.


It looks like "doNotInclude" is either a list or a set, in which case you are probably going to get in trouble with the automatic toString() function that you're implicitly invoking. You'll need to convert the list or set into a comma-delimited, quote-enclosed list of values to not include.