1

Is it possible to set conditional metadata for a document?

For instance, there are three metadatafields in my document: accountnumber, projectnumber and casenumber. A user can fill all three metadatafields but is required to fill at least one.

Martijn Burger
  • 272
  • 4
  • 15

2 Answers2

3

The best way I can see to do it is to add event receivers onto ItemAdding and ItemUpdating which checks to see if at least one of the three fields is populated, and if they are not, refuses to continue to add/update the item in question. You will probably want to implement some kind of warning in the form of a pop-up box or, if you want to be really fancy, an email that says why the add/update failed.

NotVonKaiser
  • 1,590
  • 8
  • 19
  • Sounds like a plausible solution, I am going to try to implement this. I was afraid it couldn't be solved without some custom code. :) – Martijn Burger Jun 12 '13 at 15:29
  • Yeah, I admittedly probably think code first more than I have to but I am not off-hand aware of a way to solve this without custom code. – NotVonKaiser Jun 12 '13 at 15:30
0

This requires a change in the new/edit form for that library, by e.g. inserting javascript that checks if 1 of the 3 fields has content. This is done through SharePoint Designer.

  • Hmmm, don't think that will work. It is corporate metadata, used in lots of libraries. Further it will not restrict uploading from SP Workspace or via a webservice. Possibly other options. – Martijn Burger Jun 12 '13 at 13:28