Auto Number generation using Real Time Workflow in MS CRM 2013
Hi All,
I am going to show you the example of Real Time Workflow for Auto Number generation.Follow the below steps to create Auto Number for Contact entity,
Step 1: Create a Custom Entity “Counter” with the following Fields
Counter Value: Whole Number (Range as required)
Step 2: Create One Record in Counter entity as follows,
Step 3: Create N:1 relationship between Contact to Counter entity as follows,
Step 4: Create “Contact ID” field in Contact entity as follows,
Step 5: Place “Contact ID” and “Counter_Contact” fields on the Contact entity form and hide them,
Step 6: Create a Real time workflow as follows,
Step 7: Create a step to Update “Counter-Contact” record in Contact entity as follows,
Step 8: Update Counter Value from Counter entity as follows,
Step 9: Update Counter Value by 1 in Counter entity
Step 10: Activate the Process and Create Contact Record
Please provide your valuable comments.
Excellent!! No need of plugins from now…
LikeLike
Very nice information
LikeLike
Nice information!!! But what if I need to work with Outlook Offline Client? Greetings!!!
LikeLike
I am in fact thankful to the holder of this site who has shared this enormous article at here.
LikeLike
Great Article! I’ve been thinking about doing this for a customer who wants to generate a “record id” for Accounts. However, they want their number to start with 320001. In CRM, whole numbers appear as 320,001. I don’t want that comma in my record id. Any thoughts on that?
LikeLike
Thanks Jeff.
In JavaScript onload, you can write code to replace comma with empty string. Will blog that in my next post.
LikeLike
Hi Arun – Actually, I tested this a bit more and no need for a jscript! In my CRM Admin User Preference, I can change my Number formatting to NOT have commas. Then, I just have the workflow run in context of the owner of the workflow (the CRM Admin). When I update the Customer ID text field, there is no comma! So we are good to go! Thanks again for the article!
LikeLike
Its good jeff.
But if you change Number formatting, it will effect Money related fields will appear without comma.
Check once.
LikeLike
That is a good point, it does indeed change the format of currency fields too. However, in this case it is ok. It is a personal setting that I changed just for a CRM User we have that is for administration only. So in this case, I don’t care how those currency fields appear to this seldom used CRM User.
LikeLike
I used to be able to find good info from your blog articles.
LikeLike
I do not even know how I ended up right here, however I believed this put
up was once good. I do not realize who you are but definitely you are going
to a well-known blogger when you are not already.
Cheers!
LikeLike
Thank you Marie.
LikeLike
That is really fascinating, You are an overly skilled blogger.
I have joined your feed and look ahead to seeking extra of your fantastic post.
Also, I’ve shared your web site in my social networks
LikeLike
Thanks Jenifer.
LikeLike
Thank you jenifer 🙂
LikeLike
Hello there, just became aware of your blog through Google, and found that it’s truly informative.
I’m going to watch out for brussels. I will appreciate if you continue this in future.
Many people will be benefited from your writing.
Cheers!
LikeLike
Thank you
LikeLike
Nice simple Idea so simple then again the best ideas usually are.
Have you tested this with imports or multiple users adding records at the same time?
Thanks
John
LikeLike
Prefty nice post. I just stumbled upon your weblog
and wanted to say that I have really enjoyed surfing around your blog posts.
After all I’ll bee subscribing to your rss feed and I hope you write again soon!
LikeLike
Thank you Charlene
LikeLike
Hello Arun,
you did a great job, however it failed when i’m doing migration of data all at one go. I tried to make it on-demand workflow and run it. I duplicated the id’s. I only works when you create one by one.
Thanks,
Drew
LikeLike
Very couple of web-sites that occur to be in depth below, from our point of view are undoubtedly effectively worth checking out.
LikeLike
Thanks for the information 🙂
Can you please help me on this: filtration of options on the basis of value selected.
like if i have to select between ice cream & soft drinks, if i have selected ice-cream then i only related options will be visible.
LikeLike
Will share in the next article
LikeLike
Hi Isha,
Follow the below article,
https://arunpotti.wordpress.com/2015/05/14/filter-optionsets-based-on-selection-in-ms-crm-using-javascript/#respond
Provide your valuable feedback on this article.
LikeLike
Excellent! No need to write Plug-In
LikeLike
Gr8 Arun u r rocking…
LikeLike
Thank you Manohar
LikeLike
Hi Arun,
Thanks for your solution
Just a question: how can I be sure that when two person are creating a contact at the same time there will be two different ID?
Sylvain
LikeLike
Hi Sylvain,
We can be sure of it because all the steps in this synchronous workflow will happen in single database transaction. So it won’t allow same ID counter to be updated to 2 records at any time.
Thanks,
Saikrishna
LikeLike
Wow cuz this is great work! Congrats and keep it up.|
LikeLike
Great site. Lots of helpful info here. I am sending it to a few friends ans also sharing in delicious. And of course, thanks for your effort!
LikeLike
Thank You 🙂
LikeLike
hello again. this is really true
LikeLike
hello again. this is really true
LikeLike
Hi Arun,
This blog is very helpful and useful to CRM Developers.
LikeLike
Thank you Arun 🙂
LikeLike
Hi Arun,
I am using 2016 trial account. I followed the exact way you have mentioned above to generate an auto-number. But I am not getting it. Could you help please.
LikeLike
Hi Anju,
Process is common for Custom or System Entity.
Please recheck all the steps and try again.
LikeLike
Hey, awesome webpage you have got right now
LikeLike
Thank you 🙂
LikeLike
Hello there, great site you’ve got right now
LikeLike
Thank you 🙂
LikeLike
Great web websitewebsite! It looks very professional! Maintain the good job!
LikeLike
Thank you 🙂
LikeLike
You have got superb thing listed here
LikeLike
Thank you 🙂
LikeLike
Wow, incredible blpg layout! Ꮋow lоng have you beеn blogging fοr?
үоu maҝᥱ blogging look easy. TҺe overɑll ⅼooк of your sie iis magnificent, as well
ass thе content!
LikeLike
Thank you Gus 🙂
LikeLike
Much thanks! This a wonderful web-site!.
LikeLike
Hi, Is it possible to add a generic prefix to the number? I.e I need the same three letters to appear before the auto generated numbers?
LikeLike
Hi Ashleigh,
Add required prefix, before Contact Id as mentioned in Step 8.
LikeLike
its’ working bro thanks for providing good article for Auto Numbering
LikeLike
Thank You 🙂
LikeLike
Arun great article to bring to the masses. How do you deal with duplication of auto numbers when two users save at the same time? I had thought that workflows would not run up against one another when dealing with the same entity (such as locking in C# code) but this is not the case.
LikeLike
Hi Jonathon,
There is no issue with duplicate numbers with this approach. As we are using real time workflows, CRM will lock the table until it process the next one. So, to test this scenario try to import some records using Data Import Wizard and see for any Duplicate numbers.
Thank You.
LikeLike
Hi Arun,
I did test with user interaction, meaning two users clicking save at the same time. This resulted in duplicate numbers. The exclusive locking did not appear to happen when running the Synchronous workflow.
LikeLike
Bestest Solution..:-) Thanks its very helpful
LikeLike