SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been tring to create a text field (SPFieldText) with a custom format XX-XXXX-XXXX and add a check (control) so that when you add a dokument with same property but different format to a document library. Sharepoint would alert the user that the property has wrong format. Is it possible? thanks.

share|improve this question
up vote 1 down vote accepted

The MSDN custom field type walkthrough covers a scenario very similar to your own.

share|improve this answer

You will need to create a custom Text field which derives from SPFieldText and override the GetValidatedString method. Her you can put your logic to check if the text entered adheres to the format or not. You may find this link useful:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.