Am building a dynamic SOQL where I am using a list of strings that represent record ids, here's an example similar to my class:
String q = ''; q += 'SELECT Id FROM' + object; q += ' WHERE Id IN :record_ids'; List<sObject> sobjects = Database.query(q);
record_ids has a single Id in the list it works fine, more then one and it does not bring back any records.
I have tried creating a string based
IN in many forms, for example:
record_scope += '\'' + record_id + '\',';
But when I look at the logs instead of
... IN ('00000000000001','00000000000002') I get ...
IN ('00000000000001,00000000000002') looks like
' are subtracted for some reason.
Any help will be appreciated.