Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

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: http://www.c-sharpcorner.com/uploadfile/Roji.Joy/creating-a-custom-field-type-for-sharepoint-2010-email-validation-field/

share|improve this answer

Your Answer

 
discard

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.