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
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