Questions tagged [unique-field]

Question involves characteristics and techniques related to fields which require that each record's value is different. Multiple records may have the null value.

Filter by
Sorted by
Tagged with
2 votes
0 answers
130 views

Flow triggered from Apex Test throwing error: DUPLICATE_VALUE: duplicate value found: <unknown> duplicates value on record with id: <unknown>

What happened: I have a test method calls a method in a class that ultimately inserts a new record for ContactRelation__c object. Background: The ContactRelation__c object has a field called "...
dale's user avatar
  • 121
1 vote
0 answers
115 views

Event created via composite API not showing up in Contact's activity timeline

We're seeing an issue with Events created via the composite API where one duplicate event in the composite batch is causing the other non-duplicate events to be only partially created, without their ...
Scott Hill's user avatar
1 vote
1 answer
660 views

sObject.clone() - Does this method clone values in fields marked as Unique?

Given the below Account field: foo__c Text(255) (External ID) (Unique Case Insensitive) If we use the following in Apex code, does a value in the foo__c field get copied over to the newly cloned ...
parkerbbrown's user avatar
0 votes
0 answers
624 views

Unique value check via flow?

I've built a record triggered flow that when a Contact record is created, calls an Apex method that generates a random 10 digit number and puts that value on the newly created record. However, I need ...
user avatar
1 vote
1 answer
222 views

Swap 2 "Unique" values in a single transaction

Scenario: "User" Object has a field "UNEQ" which is setup as Unique. Object "ABC" is adjusted in an Enhanced List View, which causes "User" to be adjusted via ...
TheArchitecta's user avatar
0 votes
1 answer
49 views

How to reproduce unique record based on a field value (date, account code) on data extension [closed]

Lets say I have rows of sends on contacts on a data extension. These contacts can have the same value on the column Event Date, name and account code This data extension would be like that : Contact ...
LT888's user avatar
  • 29
0 votes
1 answer
63 views

I have Protected Custom Metadata Object Relationship field and I can't make it Unique

I have Protected Custom Metadata Object Relationship field and I can't make it Unique. When I try to make it unique and generate a new validated package version, I receive the following error: ...
Patlatus's user avatar
  • 16.7k
1 vote
1 answer
515 views

How to connect an external id to another record using apex

I currently have a situation where new contacts are created with the chance of creating duplicates. The existing contacts have an external id. Since it is not possible to merge external ids with ...
Thomas's user avatar
  • 2,294
0 votes
1 answer
342 views

Way to migrate data in bulk which reference record types

Record Type standard object lacks Unique External Id field and doesn't allow to create a custom Unique External Id field, which brings a challenge to migrate data in bulk which reference record types, ...
Patlatus's user avatar
  • 16.7k
0 votes
1 answer
1k views

In Marketing Cloud Is it possible to select all rows from a data extension where a field value is unique - ie an ID field

I have a DE which has a number of rows of data (with a number of columns) ID Name date email 1 ABC 1234 @gmail 1 ABC 5678 @gmail 2 DEF 9101 @yahoo 3 GHI ...
Ap12345's user avatar
  • 15
-2 votes
1 answer
252 views

Create one Record in a Week [closed]

I want a workflow to validate the creation of only one record in a week. If more than one created within the same week, should show error. How should I do this?
Debabrata Jena's user avatar
0 votes
1 answer
27 views

Record duplication : One Record for a Day

I want to create requirement to create one record for a day. I want to do this through the E-mail field on my custom object. I have checked for "No Duplicate Value" for the email field but want to ...
Debabrata Jena's user avatar
1 vote
1 answer
191 views

At which level do duplicate rules work?

I'm trying to prevent the insertion of duplicate records from concurrent transactions. FOR UPDATE does not seem like a good candidate because the records are not updated, so there is nothing to lock. ...
ipavlic's user avatar
  • 3,694
1 vote
0 answers
220 views

Whats a good way to merge this bad pair of records, one a Contact and one a Person Account, with a unique external-ID field?

We have a checkered history at this company that caused all sorts of bad data. (I wasnt here then!) Person Accounts are enabled. Some of the customers are Person Account records, and some are just ...
ElHombre55's user avatar
0 votes
1 answer
560 views

Encrypt a text field that is both ExternalID and Unique

I am trying to determine if this is possible - Encrypt a text field that is both Unique and an ExternalID. Via deterministic encryption, I believe it is possible. I am just wanting to see if anyone ...
TestMcTesterson's user avatar
0 votes
1 answer
188 views

ExternalID need to be unique?

I am trying to make a certain field an externalID,and the background job runs, and I never see the checbox get checked. Originally, I was trying to make it both unique an an externalID, however, ...
TestMcTesterson's user avatar
0 votes
1 answer
535 views

Generating a random unique token inside a trigger using a method from a separate class [closed]

I'm using a random string generator code, which I found online. I need to know how I could access this code inside an Apex trigger from an apex class. I have pasted both my trigger and class, but I ...
Niveth Kumar's user avatar
4 votes
1 answer
3k views

Error "The proposed data changes would violate a uniqueness constraint." Sandbox specific problem?

In my partial data sandbox, I get this error when saving edits to any existing Account. I have enabled the finest debug levels, but the debug log does not give any clue as to why I get this message. ...
Sander de Jong's user avatar
0 votes
1 answer
113 views

How to accomplish conditional saving when using Unique External IDs?

I have an object with a Unique External ID field. It works fine but have a good amount of already existing records with the same value in the field. And I have a Flow which needs to populate a field ...
Zoom_v's user avatar
  • 3,860
0 votes
1 answer
307 views

apex:repeat group by/filter by field, show only unique values

So I have an SOQL query which returns an object with these fields: |Product Name|Option|Category| Category could be: A B Options could be: 1 2 3 In my VisualForce page I would like to visualise that ...
mirantii's user avatar
2 votes
1 answer
845 views

How to make an External Id field unique in a managed package?

We need to make couple of existing external Id fields unique in a managed package, But it's not possible to make them unique once released. Unfortunately these have been not made unique by mistake (...
Pasan Eeriyagama's user avatar
0 votes
2 answers
2k views

Salesforce REST upsert for externalId cause DUPLICATE_VALUE error

I send next upsert request to Salesforce: PATCH /services/data/v41.0/sobjects/Task/uuid__c/a22ac4d6-e2c0-4e53-898d-ea1d0c807775 HTTP/1.1 Host: **********.my.salesforce.com Content-Type: application/...
KorbenDallas's user avatar
0 votes
1 answer
2k views

How can we change existing managed package field to unique?

We have couple of fields across few objects need to be made unique. These have been released a while ago, and we need to modify them to become unique. But when we try to change the Unique - Do not ...
Pasan Eeriyagama's user avatar
18 votes
1 answer
6k views

Is Username Globally Unique?

I was under the impression that the Username field on the User object is globally unique. In other words, even if a value is used in some other instance, that means I cannot create a User record with ...
Adrian Larson's user avatar
  • 150k
0 votes
2 answers
3k views

How to determine the value is unique

I have a formula field to display after concatenate the three different fields value. formula shown below: TEXT(Account_Code__c) & "-" & TEXT(Account_Code2__c) & "-" & TEXT(...
Nick's user avatar
  • 7,012
4 votes
2 answers
3k views

Case Sensitivity during Field Creation

I noticed something odd in the way Uniqueness is worded when creating a new field. The two radio buttons are worded as: Treat "ABC" and "abc" as duplicate values (case insensitive) Treat "ABC" and "...
Dan Jones's user avatar
  • 7,187
8 votes
2 answers
2k views

How to create SQL like composite key

I have an object in which there are two fields i.e Phone no. & email. The combination of these fields should be unique Right now I can create just one unique field But I want their composite to ...
GrV Aneja's user avatar
1 vote
0 answers
371 views

How to check the uniqueness of a field

I need to check persEmail field whether it is used by another person account or not . When i tried to make it unique by checking the checkbox inside the field , it throws error like "Error: Duplicate ...
user27111's user avatar
0 votes
1 answer
763 views

Make picklist unique for a value - Configuration only

I have a picklist on a custom object with values A,B and C. I want only one record of the object with the value of the picklist = C. It is perfectly fine if the other records have the value A or B ...
Prajith's user avatar
  • 1,559
0 votes
0 answers
96 views

SOQL query to get greatest value from unique ID or Custom Setting

trying to figure out the best way to increment a uniqueID value by 1 when leads are inserted into our org. Our externally required uniqueID is formatted as follows XX-YYYYY, where XX has values of "...
StartingAgain's user avatar
3 votes
1 answer
4k views

What happens if I make an existing custom field Unique and there are already duplicate values?

If I have an existing custom field where there are some duplicate values across records, but which should ideally be a unique key, is it possible to make it unique? If so, what happens to the existing ...
OBerm's user avatar
  • 1,224
3 votes
1 answer
11k views

Null or Empty value are allowed in Unique and External ID text field

I have created a text field in a custom object, and checked the option for External ID and Unique only but not the Required option. i want know if this text field will allow a NULL or Empty value ? ...
vijayakumar subramanian's user avatar
2 votes
1 answer
68 views

Auto-detection of duplicates in import. To avoid multiple imports

Say I have three Unique(External ID) Fields (Email, Phone, Mobile) But in my file, I do not have values for all three fields for all the rows. But I have atleast value for any one of the field. In ...
Jai Ganesh's user avatar
2 votes
1 answer
3k views

Having a field linkable like the object name

Basically, on the Account page, I've a related list called 'Rate', which has a field called 'Rate Group' You can click on Rate Group to go to the Rate Group page, but I was wondering if I could make ...
Sam's user avatar
  • 85
3 votes
1 answer
1k views

How to create a trigger that checks a field from the object is fired from

Hello and thanks in advanced. -Background- I have a custom object for files, one of the files recorded in this object needs to be the primary file, but only one. -Approach- Create a trigger that ...
Jose's user avatar
  • 2,142
3 votes
1 answer
764 views

Changing a Case Insensitive field in Managed Package

I have a "Dupe Detector" field in a couple of objects that is Unique (Case Insensitive). It is a Text(255) whose value is updated by a Workflow Field Update. We have recently had the problem that ...
George S.'s user avatar
  • 2,730