TheGeezer2010
asked on
Sharepoint 2010 SharepointDesigner Workflow Auto-Update Column
Have been studying all the articles about how to achieve this, but completely stuck at the creating Workflow and cannot follow the suggestions which all seem to relate to MOSS 2007 and NOT SP 2010.
Requirement is to create a Custom List which has a column which we can apply a prefix (e.g. CRM), and then have an auto-incrementing number which can go from 0001-1000 (for example). It needs to be unique, and can be removed if required.
I have managed to create a really basic list which uses simple constraint formula on the "Title" column, and creates a calculated version of the requirement. But of course, this is not unique, and has no error checking to ensure the correct (next) number is being enetered into "Title" column. If this was entered incorrectly, my feeling is the whole list would become a mess.
I have followed up until the point where you create a calculated column (say =Number+1), but then when it says to create Workflow to do the updating/inserting etc, I am afraid my knowledge seems to end there.
Can anyone, using SP2010 and SPD 2010 please explain or provide link which I can follow to achieve this.
Thank you
Requirement is to create a Custom List which has a column which we can apply a prefix (e.g. CRM), and then have an auto-incrementing number which can go from 0001-1000 (for example). It needs to be unique, and can be removed if required.
I have managed to create a really basic list which uses simple constraint formula on the "Title" column, and creates a calculated version of the requirement. But of course, this is not unique, and has no error checking to ensure the correct (next) number is being enetered into "Title" column. If this was entered incorrectly, my feeling is the whole list would become a mess.
I have followed up until the point where you create a calculated column (say =Number+1), but then when it says to create Workflow to do the updating/inserting etc, I am afraid my knowledge seems to end there.
Can anyone, using SP2010 and SPD 2010 please explain or provide link which I can follow to achieve this.
Thank you
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
OK two bits I am stuck on. I presume I need to create the structure of the target list/library BEFORE creating and publishing the workflow. I really do not have any kind of development brain so can you advise what columns and what types of column (lookup, calculated etc) I will need to achieve this please ?
As I say, we need a list which will create auto-incrementing Project ID starting at say CRM0001, and taking account of number of zeros needed (i.e. we dont want it to change from 0009 to 00010, needs to go to 0010 (i.e. drop a zero IF second last field populated in the number etc)). Just needs to have following fields (I can add rest if need be) :-
Project ID, Date Created, Description, Status (can create this from drop-down choice), Owner (as previous column)
The other opart not sure about is how to create the item CRM+0001 - but I think I can simply create a column which is Project code (choice-drop-down say CRM, PIM, TRW etc), the appended number will be the column auto-updated based on previous number created and saved + 1, and the column Project ID would append the Project Code to auto-number ?
This seems a very complex thing to achieve in Sharepoint ??
Thanks for all your help
As I say, we need a list which will create auto-incrementing Project ID starting at say CRM0001, and taking account of number of zeros needed (i.e. we dont want it to change from 0009 to 00010, needs to go to 0010 (i.e. drop a zero IF second last field populated in the number etc)). Just needs to have following fields (I can add rest if need be) :-
Project ID, Date Created, Description, Status (can create this from drop-down choice), Owner (as previous column)
The other opart not sure about is how to create the item CRM+0001 - but I think I can simply create a column which is Project code (choice-drop-down say CRM, PIM, TRW etc), the appended number will be the column auto-updated based on previous number created and saved + 1, and the column Project ID would append the Project Code to auto-number ?
This seems a very complex thing to achieve in Sharepoint ??
Thanks for all your help
SharePoint is indeed a complicated beast when you try to do anything out of the ordinary.
Correct, the structure must be in place to attach the workflow.
The list would have Project Code-Choice Field for your 3 character prefixes; then a Project ID column which would just be a text field and that's where we will concatenate Proj Code + Item ID into a unique identifier.
To work around the zeroes (this is kind of ugly), it would be a simple matter of some conditional statements:
IF field ID in current item is greater than 999 then Proj ID = Proj Code + '0' + ID
ELSE IF field ID in current item is greater than 99 then Proj ID = Proj Code + '00' + ID
ELSE IF field ID in current item is greater than 9 then Proj ID = Proj Code + '000' + ID
The logic above is straight forward, but to do it technically in SharePoint Designer you will create an action to "Set a workflow variable" and that's where you will create the string you need that contains: Proj Code, Correct # 0's, and Item ID; one action per IF since there are different # of 0's.
Then you will "Set a field's value" the field being proj id and the value being a "workflow variable".
Note: With this approach, there is no guarantee that the next number in the sequence will be exactly + 1 every time because you may create something and then delete it, thus incrementing the number a second time.
Regards,
Matt
Correct, the structure must be in place to attach the workflow.
The list would have Project Code-Choice Field for your 3 character prefixes; then a Project ID column which would just be a text field and that's where we will concatenate Proj Code + Item ID into a unique identifier.
To work around the zeroes (this is kind of ugly), it would be a simple matter of some conditional statements:
IF field ID in current item is greater than 999 then Proj ID = Proj Code + '0' + ID
ELSE IF field ID in current item is greater than 99 then Proj ID = Proj Code + '00' + ID
ELSE IF field ID in current item is greater than 9 then Proj ID = Proj Code + '000' + ID
The logic above is straight forward, but to do it technically in SharePoint Designer you will create an action to "Set a workflow variable" and that's where you will create the string you need that contains: Proj Code, Correct # 0's, and Item ID; one action per IF since there are different # of 0's.
Then you will "Set a field's value" the field being proj id and the value being a "workflow variable".
Note: With this approach, there is no guarantee that the next number in the sequence will be exactly + 1 every time because you may create something and then delete it, thus incrementing the number a second time.
Regards,
Matt
ASKER
Sorry Matt
6 onwards are still not clear to me. I have tried setting a workflow in SPD 2010 earlier and it is not that easy !!
I think if you could walk through the actual workflow (s ?) to create, that will set me on my way !!
Thanks for your massive patience !!!
6 onwards are still not clear to me. I have tried setting a workflow in SPD 2010 earlier and it is not that easy !!
I think if you could walk through the actual workflow (s ?) to create, that will set me on my way !!
Thanks for your massive patience !!!
ASKER
Can anyone help with this please ? I am struggling to understand what Matt has said here so cannot put it into practice ?
Thanks
Thanks
ASKER
Going to revisit this as I think it is a matter of creating a variable which is linked to the ID column, but using the formula as a prefix to the variable ? Does that sound right ?
ASKER