We have a scenario where in the before insert trigger of object Asset, which looks for a duplicate and if a duplicate is found a record is inserted in the junction table and after the dml is complete, we have an adderror method throw an error message letting the user know of the situation.
The problem is that the DML on the junction object is completed but rolled back when adderror method executes.
Things i have tried.. Having a savepoint, Saveresult, Writing the dml of junction object in another class, setting the allornone parameter to false and none of these have helped.