我最近在编写自定义SharePoint Field时,发现了一个有趣的问题。
如果在Field对应的Control中重载了UpdateFieldValueInItem函数,那么在Field中进行值校验时抛出的SPFieldValidationException异常将不会被SharePoint Service扑获,从而无法实现在New或Edit一条记录时,对Field的自动错误显示(如:You must specify a value for this required field.)。原因应该是该异常该为了在Control中的UpdateFieldValueInItem函数抛出了。