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
Patrick MayerPatrick Mayer 

Just starting with Apex. [object Object]: duplicate value found: error

Relitively new to this platform. Trying to create a really simple trigger on a Task. I took out any of my code in the actual trigger, but every time I try to save I get a "[object Object]: duplicate value found: ScopeId duplicates value on record with id" error message. I really have no idea where to start with this one.


trigger updateNameToPrimary on Task (before insert, before update) {

}

 

 

Patrick MayerPatrick Mayer
Spent about an hour messing with some completely unrelated tutorials. Went back to the code and now it saves fine. So I guess if anyone has an explanation that would be cool. Otherwise, I'm good.
Shahroz BegShahroz Beg
Hi, 
ScopeId in your case must be unique but your code may be either creating or fetching duplicate ScopeId that's why this error popping up.

Thanks.