+ Start a Discussion

clean up record ID



I had an object A where I  fire a triggger after update  to create an Event and task. Record Id of event and task are stored on object A.  but on some condition if i delete  Event and task,  record id fields are not deleted on object A.  i need to clean up the record id fields stored on object A when event and task are deleted. here is my code


for (objectA a: inactive records){




list<event> lstevents= [select id from event where Id in: listeventIDs and startDateTime>:now()];

list<task> lsttasks=[select id from task where Id in :listtaskIds and status='not started'];



delete lstevents;



delete lsttasks;




how do i clean up the record id fields on object A when task and event records are deleted.


plz help??//