Notifications
Announcements
No record found.
How to create a unique identifier for a custom entity?
*This post is locked for comments
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
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
Thank you for responding, can you tell me how to create auto numbering for the primary field of my custom entity.
Hi Shiva,
community.dynamics.com/.../auto-numbering-with-crm-workflows-real-time-vs-asynchronous
Above link my help you for custom entities. for other entities.
www.microsoft.com/.../change-auto-numbering-prefixes-for-contracts-cases-articles-quotes-orders-invoices-and-campaigns.aspx
Hope this Helps
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2