+ Start a Discussion
tejateja 

relationship Soql query

 

 

kranjankranjan
Hi Teja

You cannot use count in subquery. You would need to use smoething like this and then process your records based on count of tasks for each lead and update the respective field.

select l.id, (select id from tasks t where t.status <> 'Completed') from lead l where l.recordtype.name like 'AHIT%' and l.isconverted = false and l.open_tasks_count__c = null

Regards