Another Salesforce blog!!!

Salesforce, Apex

Use Set in dynamic SOQL IN-clause in method without Database.query()


public String inClausify(Set<Id> ids) {
    String inClause = String.format( '(\'\'{0}\'\')', 
                         new List<String> { String.join( new List<Id>(ids) , '\',\'') });
    return inClause;
}

LINK

LINK2

Leave a Reply

Your email address will not be published.

*