I have a document library with required fields. When the user uploads a document and closes the Properties window without entering the required fields, the document is still uploaded, but is left checked out.
If the user subsequently attempts to check in the document without first editing the properties to supply values for those required fields, an exception is thrown and the user sees the following:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
The Event Log shows the following:
Exception message: You must fill out all required properties before checking in this document.
Request path: /_layouts/checkin.aspx
Stack trace: at Microsoft.SharePoint.ApplicationPages.Checkin.OnLoad(EventArgs e) ...
I would like to trap this error and present it to the user or somehow prevent the check-in event from getting far enough to cause this exception.
I have tried coding something like this:
public override void ItemCheckingIn(SPItemEventProperties properties)
catch (SPException ex)
properties.Cancel = true;
View Complete Post