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)

Uniqueness of GUID

(0) ShareShare
ReportReport
Posted on by 785

Hi all. Strange question. I am developing an app that works with CRM and gives customers a user interface. I am trying to plan a way to non-interactively create unique usernames for them on my app based on CRM. The only unique thing I can find to the accounts is the GUID. Unfortunately,  a full GUID looks like 12748588-D27B-DE11-97F1-08002770019E, which is a little long.

Does anyone know what the separate parts of the guid represent, if anything? Is there a chunk of the GUID that I could use and be certain that it will be unique to the account (say 12748588 for example)?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Joe Gill Profile Picture
    on at

    Hi Michael,
    As you are probably aware the GUID is intended to be a Global unique identifier across any application. One of the reasons it is used is where you have disconnected applications systems which must share and synchronise data at some point. In CRM’s case you can create contacts in Outlook offline and at some point synch with CRM and the GUIDs of the records will never conflict.
    I would suggest you create your own attribute and logic in CRM to hold you username rather than use the GUID.

    HTH

    Joe

     


     

  • Michael Xavier Profile Picture
    785 on at

     Hi Joe,

     Username would be unique for systemusers but we also want to store customer accounts, which unfortunately don't seem to anything completely unique a bout them other than the GUID. So there's no part of the GUID we could parse out and be guaranteed that its unique?

  • vishal swami Profile Picture
    on at

    michael,

    what about having a unique number series and assigning the same to the account number.

  • Michael Xavier Profile Picture
    785 on at

    [quote user="vishal swami"]

    michael,

    what about having a unique number series and assigning the same to the account number.

    [/quote]

    I could do that. What would be my general strategy, I'd need to create something fairly short and unique and have it hook to account creation automatically, since all of our account data is imported through a small import program.
  • Joe Gill Profile Picture
    on at

     Hi Michael,

    I don't think yo could use part of the GUID as an ID. I guess the the size and complexity of the GUID reflects it purpose

     

    I will  try an did out some code that does what you need once I get a minute

     

    Cheers

    Joe

     

  • Michael Xavier Profile Picture
    785 on at

     Hi Joe,

     Any luck with that code? I've been toying around with some ideas and at least from my observations it seems like the first 8 characters of a GUID seem to be unique. I was thinking about just converting the base on those to an int and then using that as a makeshift ID.

     I would however like to see what you come up with but if you can't think of anything, would you be able to point me in the right direction as to how to do simple hooks for after a record is created? I ideally want to insert this derived ID into a field visible on the form but make it read-only and I can't seem to find how one would do that short of creating an entire plug-in.

     Best regards,

    Michael

  • nikejsf Profile Picture
    15 on at

    has there been any further help on this? I, too, notice the possibility of 'uniqueness' to the first 8 characters but obviously would like to be sure before doing any implementation. :/

    Thanks!

  • Neil Benson Profile Picture
    7,369 User Group Leader on at

    No part of the GUID is unique when taken in isolation from any other part. Imagine the GUID was a four digit numbering sequence in which the numbers 1234, 1334 and 1235 appear. You are asking which two digits you could use and still be guaranteed that it's a unique number. 12 appears in the first and third; 34 appears in the first and second. It's the same with GUIDs.

    The solution is to use an autonumbering solution. There are lots of commercial and some opensource autonumbering solutions available.

  • nikejsf Profile Picture
    15 on at

    yeah I definitely understand your point and thanks for replying! I ran a query against 6300 records and there weren't any dups for the first 8 characters. actually weren't any dups for first 7. only 1 dup for first 6. just fyi. I understand this may not be statistically negliable as compared to a full guid, but I think it's a start in my case.

  • nikejsf Profile Picture
    15 on at

    im also looking these autonumbering solutions you mentioned. thanks for that. I was hoping to not have to introduce a new 'counter' entity to achieve this, but we'll see :)

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