Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Alternate key

Posted on by 524

Hi,

I need to create a alternate key for emailaddress1 in contact entity. Since the entity has already thousands of records having empty email address, it doesnt allow to create alternate key. I need this to be created, because, the third party vendor passing emailaddress as the reference for the contact entity record. Is it any work around to create the alternate key. 

  • Suggested answer
    ankit_singhal Profile Picture
    ankit_singhal 560 on at
    RE: Alternate key

    I think there is no way OOB in online CRM but you can write custom code and apply that on pre validation

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Alternate key

    Hello,

    Blank (null-valued) fields shouldn't be a problem creating alternate keys - I'm pretty sure it's related to duplicates within the table.

    I experienced a similar situation and in order to identify duplicate records I used the following approach:

    1. I created a DB and exported the data from the table into it.

    2. I run a query to identify duplicated emails.

    3. Having duplicated emails through the dataverse interface I just found records and either deleted duplicates or updated emails to remove that constraint.

    An alternate approach you can rely on is duplicates detection - create a duplicate detection rule by your email address and run the duplicates detection job. Go and fix the results of that job.

    Once you have your duplicates cleaned up - you would be able to enable your alternate key.

  • Suggested answer
    XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: Alternate key

    Hi,

    You can create an alternate key with a null value in your records. You must not have any duplicates (except for nulls).

    If you have empty strings, you can replace them with null in order to create your key.

    Example:
    I have records with null in emailadress1.

    pastedimage1682959549622v2.png

    But, I can use the alternate key to find an account.

    pastedimage1682959417637v1.png

    Used query:

    /api/data/v9.2/accounts(emailaddress1='someone6@example.com')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans