SharePoint 2013 Automatic Title (text field) Generator

The main idea of this project at its start was dynamically generate the title of the item in list when you create or update the list item. Why did we need it? Very simple.

In almost every project, we need to create some dictionaries with plain data, like period’s list, or computers list with additional information, or something like this.

Moreover, not every time you want to define the title of the item. There is no way to define a formula for title (this is not a calculated field). Sure, you can delete the title field from the list definition, but it will be incorrect decision. The correct answer is to make title field not required and invisible in display/edit/new forms

However, if you use this list as a lookup in a different list, what will you choose for a lookup field? There is now field to extend indent the item.

Therefore, to solve this problem, you should write your custom event receiver in which you get the values of interested fields, generate a string for title, set this string to title field and update the item. Moreover, you need to implement this solution on each list.

So, we needed this solution in every project and in a lot of lists. We decided to implement this solution with suitable user interface to define the templates for automatic generation of title.

The second idea was “Why only title? I want auto generation on every text field and to manage this process without SharePoint restrictions”. Sure, why not? Now we can create templates for every text-typed fields.

But you have to understand, that this solution doesn’t replace or extend the formulas possibilities in calculated fields, but helps to generate simple strings by templates

 

The main features of this solution:

  • SharePoint 2013 Sandbox solution.
  • SharePoint 2013 Foundation, SharePoint 2013 Server, SharePoint Online support
  • Setting up the field for extending values
  • Template with field mask for automation values calculated fields style
  • Adding the existing field to a template from the list of fields
  • Setting up the datetime template for casting date into string for each selected field
  • Setting up the field required for selected field
  • Setting up the field read only for selected field
  • Setting up the field show in edit/new forms for selected field
  • Setting up the field show in display form for selected field
  • JSOM collaboration with SharePoint from settings page
  • SSOM async event receivers for generation of the complete field value

Last edited Dec 4, 2014 at 11:00 AM by SergeiSnitko, version 6