Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to know if an attribute is unique

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I tried to create a record in Dynamics CRM 365 (with c# code), I got an exception "cannot insert duplicate currency record. Currency with the same currency code already exist ... ". So here the currency code attribute is unique.

My question is how to know if any attribute of any entity is unique.

I tried to retrieve the KeyAttribues of the previous entity but it is empty.

Any help please.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to know if an attribute is unique

    In that list of property, I'd like to find something such as "IsUnique"

  • Suggested answer
    meenoo Profile Picture
    meenoo 7,316 on at
    RE: How to know if an attribute is unique

    Hi E2M,

    Is this what you are looking for?

    community.dynamics.com/.../metadata-and-entity-metadata-browsers-in-microsoft-dynamics-crm-2015

    Thank you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to know if an attribute is unique

    Actually, I want to know if any attribute is unique or not (it's property), like these ones :

    msdn.microsoft.com/.../microsoft.xrm.sdk.metadata.attributemetadata.aspx

    But I can't find something like that.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans