I have a Javascript button, I need to check the number of records having same Owner ID through a SOQL aggregate query. ActIds contains the all selected Activity__c records IDs
var ActIds = [];
var AggregateResult_Owner = sforce.connection.query("SELECT OwnerId, count(Id) FROM Activity__c WHERE Id IN (\'' + ActIds .join('\',\'') + '\') GROUP BY OwnerId");
On click of button, this query is throwing an error 'MALFORMED QUERY'
Any help will be appreciated
ActIdsarray been set with the values