I am trying to get the latest task created on Lead from task object.
My scenario is that if there are 2 leads - Lead1 and Lead2. And both have 2 task created for it, Lead1 contain taska - (created date = today) taskb - (created date = yesterday). And for Lead2 contain taskc - (created date = today - 2) taskd - (created date = today - 4).
It should give result of all the latest created task in the lead1 and lead2 (Result - lead1 (taska) And Lead2(taskc)).
Please provide me the possible ways to do this scenario.