Is it possible to prevent single record from being inserted in before trigger without addError()
? I'd like to be able to insert just a subset of inserted records without throwing any errors.
1 Answer
If you are doing bulk insert from apex then use Database.insert
and it will only add error to specific record and will not stop other. Dataloader already provide this functionality.
Also don't forget to add all or none
flag .
Database.insert
and it will only add error to specific record and will not stop other. Dataloader already provide this functionality.all or none
flag indatabase.insert