I was faced with a requirement to produce unique project numbers in sequence despite of the project EPT type. Project numbers such as: PPMxxxxxx (x are consecutive numbers starting from 000001).
- Project Server 2016 or Project Online.
- SharePoint Designer 2013.
So this was the approach I took in producing the unique project numbers:
- Create a custom SharePoint list in your PWA e.g. “PS Unique Number”
- Make the column “Title” not required and create a new column called “Project Number” (with a number field type) and add a second column “Project Name” (with a text field type).
- Create the first entry with the number you wish to start with. A minimum of one entry is mandatory! And make sure the “Project Name” field is not empty (for the sake of completing this process, just enter PPM).
- Create an enterprise project level custom field called “Project Number” and set the field type to Number.
- And now, create an enterprise project level custom field called “Project#” and set the field type to Formula. This formula concatenate a prefix (in this case “PPM”) with the auto-incremented number. This allows the zeros to stay in place.
- In the Site Workflow, set up the below.
To describe each actions from the Workflow above, here are the break downs:
Only set a project number if it wasn’t previously set.
Look for the next consecutive number from the SharePoint list “PS Unique Number:Project Number” and insert the variable to “varProjectNumber”.
The workflow will look in the data source “PS Unique Number” and retrieve the “Project Number” as Double.
And this is where the role of “PPM” value comes in. To find the next consecutive and available number, the workflow will retrieve it from the first entry which has “PPM” value in the “Project Name” column. As we have set up only one entry with “PPM”, it will retrieve the number accordingly.
Set the custom field “Project Number” to the variable “varProjectNumber” mentioned on the previous action.
Update the entry in the SharePoint list and replace the “PPM” with the actual project name. Later we will create a new list item with a name “PPM”.
In this example, we increment the variable by 1.
Create a new line item in the SharePoint list, setting the Project Name to “PPM” and the Project Number to what will be the next available number.
Publish the project to populate the Project# with value.