Question

I would like to create a calculated value for the mandatory Title field:

<username, created by> - DD-MM-YYYY

That is I want the title to be filled in with the user name (the user that creates the item) and the date (for creation). Can this be done automatically and if so, what should I put in the field below the "calculated field" radio button. If this cannot be done this way, I can use a workflow to set the value, but what should be the choice of workflow?

(sorry if the naming is a little off target I'm not working with an english version of SharePoint).

Was it helpful?

Solution

Just to be clear: title is only "mandatory" if you create lists using the GUI. When you provision your own list using code or CAML you can create lists without Title.

If you insert the formula

=Me&" - "&TEXT(Today,"dd-mm-yyyy")

into your calculated value, you should get something close to what you want.

Be aware though that at any time the user can insert something else into the field.

To get around this, you could either create the list from scratch and hide the site column or insert the value using an event handler in the ItemUpdated event (more on event handlers)

OTHER TIPS

You may want to rethink this approach for creating a title. The typical guidelines for document metadata recommend keeping each metadata column/field focused on a single specific type of information. This approach provides much better searching and document management functionality.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top