Questions tagged [duplicate-value]

The tag has no usage guidance.

4
votes
1answer
41 views

Apex Class Deployment: duplicate value found: <unknown> duplicates value on record with id: <unknown>

As many others have already done, I am providing yet another cautionary tale of the elusive, misleading, and downright frustrating, magical error: duplicate value found: <unknown> duplicates ...
0
votes
1answer
99 views

Process Builder fail when creating new records due to duplicate value not allowed in a field

I'm getting the error below: We can't save this record because the “Legal Contract: Updates - New Records” process failed. Give your Salesforce admin these details. This error occurred when the ...
0
votes
1answer
36 views

Method does not exist or incorrect signature: void put(String, String) from the type Map<String,Map<String,String>>

Below code throws this error: Method does not exist or incorrect signature: void put(String, String) from the type Map<String,Map<String,String>> Code: //I have this map Map <...
0
votes
2answers
73 views

Trigger to prevent duplicate combination of 3 fields on insert and update

We have 3 picklist fields Dom1, Dom2, and Dom3. We want to write a trigger before insert and update to prevent duplicate records with the same combination of these 3 fields. For Example: Dom1 ...
2
votes
1answer
246 views

Duplicate Rule Details - How to get in Apex exception

I am getting a duplicate rule issue with apex first error: DUPLICATES_DETECTED, Use one of these records?: [] Now I want this rule to run, however, I need to get the details of the record that is ...
0
votes
1answer
38 views

i m trying to avoid duplicate product code in opportuinity line item but its not updating

trigger duplicatecode on OpportunityLineItem (before insert) { { Set<String> setProductCode= new Set<String>(); For(OpportunityLineItem nam : trigger.new) { ...
1
vote
1answer
110 views

Converting Set to List creates duplicates of my Sobjects

I am adding manipulated Accounts to a Set multiple times and update it. It fails due to a Duplicate id in list exception. What should be impossible, because the values are coming from a set. After ...
0
votes
1answer
33 views

Can a Random String Generator create duplicate values, if so how to stop it?

I want to know whether this code can create multiple instances of the same random number by any chance? Can i make this specific field to not have same values within salesforce it self? trigger token ...
2
votes
2answers
245 views

Updating Map values returns list exception (row with duplicate Id at index: X)

I have a list of tasks that need to be updated. To avoid duplicates, it first gets converted into a Map<Id, Task> whose values are updated as follows: Map<Id, Task> mapIdTasksToUpdate = ...
0
votes
2answers
50 views

How to build a testdatafactory without error : DUPLICATE_VALUE, duplicate value found: duplicates value on record with id: : []

I an trying to create a testdatafactory which i can use to call in my tesclasses. What I want to achieve is small buildingblocks with which I call another method if a lookupfield needs to be filled. I ...
4
votes
3answers
159 views

Duplicate class objects in a set

I am having 2 instances of a wrapper class holding the same values. Then I add both instances to a Set of that wrapper class and both instances are present in the set. Say this is my code: public ...