Simple example of using a Real Time Workflow and a Custom Activty to Auto Number
Try it without building the code...simply import ctccrm_AutoNumberSequence_1_0_0_0_managed into your CRM organization
Remember to try things in a test organization (running with sharp objects can cause injury also FYI...)
Setup to Auto Number Account on the built-in Account Number field
-
Import Auto Number Solution (make sure to refresh to pickup navigation change)
-
Navigate to Settings -> Auto Number Sequences
-
Add a record using Name = Account and Current Value = 0
-
Create a Real Time Workflow against the Account Entity
-
Insert a step into the workflow from Utilities->Auto Number
-
Edit the properties on the Auto Number step and set Sequence Name = Account
-
Insert an Update Record step following the Auto Number Step
-
Set the properties Account Number to the Next Value of the Auto Number Step (Use the Form Assistant Local Values)
You could do the same thing on any other entity, you would just have to add a field to store the "number"