How to programmatically update document content when check-out required and required fields not filled in?

We have a document library that contains a number of documents that were added before a column was marked as 'required'.

The document library also has the force/require checkout flag set.

In this case it appears there is no way to programmatically update the content of the old documents without also supplying a value for the required columns, as when you call CheckIn (currently testing this with CSOM, but I'm assuming it's the same for the REST and the server-side APIs) it throws an exception saying values must be filled in for the required fields.

We don't want to be putting arbitrary values in these fields (in some cases there's no obvious value to put), so other than programmatically turning *off* require checkout for the library at the point we update it, or programmatically turning off the required flag for the fields in question (and restoring such flags afterwards) I'm not sure what the best approach is. The "CheckRequiredFields" flag used in the File.SaveBinary parameter doesn't appear to affect what happens at CheckIn time, and CheckIn has no options to control this behaviour.


April 16th, 2015 1:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics