Monday, July 25, 2011

Auto Increment Columns in SharePoint 2010/MOSS

As more and more applications are using SharePoint to store data and they want it to work simillar to SQL. How do you create auto increment columns?

The process is pretty cool. It would require sing SPD workflow.

Here are the steps:
-Add another column to list (Note: You cannot use ID as that is the internal column)
-List Settings->Advanced Settings->Manage Content.
-From List Settings page, click Item Content Type, and then click new column name.
-Next, choose the option to hide the column in the form.
-Goto SPD and create a workflow with "Update Item" in the list action and then set the new column to a value with current item:ID .
-Check for errors->Publish - >Save
-Finally, don't forgot to check the workflow to be staretd automatically as this is not the default.

No comments:

Post a Comment