web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Creation of a unique identifier

(0) ShareShare
ReportReport
Posted on by

How to create a unique identifier for a custom entity?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    When you create a custom entity, the primary key will automatically be created. If you're creating an instance of that entity and want to specify the primary key, it would be something like this:

    Entity entity = new Entity("new_test");

    entity.Attributes["new_testid"] = new Guid("688008C8-F95D-4158-BAB2-A3F695D7BEEF");

    Hope this helps! I'd appreciate it if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Shiva

    By default a custom entity created already had the guid as unique identifier.

    If you want to create like a code to make this more readable and unique then yes you need a auto numbering to prevent any duplicate.

    Thanks

  • Community Member Profile Picture
    on at

    Thank you for responding, can you tell me how to create auto numbering for the primary field of my custom entity.

  • Suggested answer
    vinod shivoor Profile Picture
    1,225 on at
  • Community Member Profile Picture
    on at

    For UID on each new record create, Create one new custom entity for this specific feature with one field on this  form(Integer Type). Initialize this record with 1. On each record save increment this number by one and assign he same to  the new record. Let me know if more details required on this.

  • Community Member Profile Picture
    on at

    Thank you Gaurav

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans