0

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.

1

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

1

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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