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
SFDC Coder 8SFDC Coder 8 

Apex trigger for Task

Hi All,
I am creating a task using batch apex. Through batch apex I am inserting 50% data into Task (From Custom object1).
Remaining data I have in Custom Object2.
I want to get that data by using Trigger
I want to compare Account Id of Task with Custom Object 2(I have Lookup to Account in Custom Object2).
Can I do this by using Trigger?
Now, on which object I have to trigger and how syntax should be?

Thanks in Advance
This can be done in task trigger. If you need to populate the data from custom object 2 when task is being created you should use task trigger. You can do the data population from Custom Object2 in a before trigger.
Mahmood ButtMahmood Butt
Why don't you do it in another batch which would run in the "finish ( ) " of your first batch. That way you'll be sure what data is in the system.