Hello, I have spent a couple of hours trying to figure out how to define a workflow that creates an autonumber. (Ultimately, I wish to create a unique barcode for each record in an entity.) I have reviewed multiple links, but so far I can't figure out what was actually done to make it work. Can someone give me a little help? (BTW, we use CRM 2011.)
We have an entity. Let's call it Entity 1. I added a barcode field. For the existing records I created barcoded values that look like this: *10001*, *10002*, etc. The workflow that I wish to create would create a unique barcode when any new record is inserted into Entity 1.
Following several examples I have seen online, I created another entity. Let's call it Entity1_Autonumber. I added three fields: Prefix, Count and Suffix. Prefix and Suffix are text fields of length 1. The count field is a whole number. For Entity1_Autonumber, I defined a 1:N relationship back to the entity that I wish to store the autonumber (i.e., Entity 1).
I created a form for Entity1_Autonumber. I added a single record. Prefix gets '*'. So does the Suffix field. The count is defined as 10042. (This is the last number for the barcode field in Entity 1. Using my data so far, the last barcode is *10042*. When I create a new record in Entity 1, I want the barcode field to be populated with *10043*.)
Now for the fun part. I created a Process/workflow. The entity for this work flow is Entity 1. The workflow is designed to run when a new record is created for Entity 1. I add a new step. I choose "Update." I also choose the related entity (Entity1_Autonumber). My purpose is to first increment the Count field for Entity1_Autonumber, then build a new barcode and make sure the created record (in Entity 1) receives it.
I set the properties for this step. The three fields for the related entity appear on the left. (They are: Suffix, Count and Prefix.) The fields are blank. On the right I have the "Form Assistant." At this point I am mystified. How do I increment the count field by one? I can use the Form Assistant and put the name of the field in the Count text field. But I can't figure out how to add a "+ 1" anywhere.
So far I can't finish the step of incrementing the related Entity1_Autonumber Count field. This is step 1. I would still need to figure out how to take the new count field and stick it into the Barcode field for Entity 1, along with the leading and following asterisk.
Can someone out there lend a hand? I should think that a definitive reference for defining autonumbers that even a CRM newbie using an old version of CRM would be of value to this community. So far I cannot follow the solutions that have been offered.
Any help is greatly appreciated.