You need to sign in to do that
Don't have an account?

Deleting ids
Hello,
Is there any way of deleting a collection of objects via their ids in Apex, e.g. delete(ids)?
The reason I'd like to do this is that I have a complex trigger which has to delete
> 10 different custom object types. The problem is that I keep hitting governor limits, which I guess
is due to using delete() on each object type.
To overcome this, I was hoping to be able to collect them all as a Set(<Id>) and
then mass delete them.
Andy
Is there any way of deleting a collection of objects via their ids in Apex, e.g. delete(ids)?
The reason I'd like to do this is that I have a complex trigger which has to delete
> 10 different custom object types. The problem is that I keep hitting governor limits, which I guess
is due to using delete() on each object type.
To overcome this, I was hoping to be able to collect them all as a Set(<Id>) and
then mass delete them.
Andy
Would appreciate it if you could test this. I can a type invalid error when compiling it for delete(x)
where x is a set of <ID>.
Thanks,
Andy