0

I have a document library which has some custom values, some of which are required to fill out.

When a user uploads a Document sharepoint asks him to fill out those values and refuses to check the document in if they aren't filled out. Which is okay.

This Library also has an EventReceiver attached to ItemAdded which fills out those required fields and automatically checks the item in. This works.

However, the popup querying the user to update the fields happens before the EventReceiver updates all the required fields, which causes the File to already be updated in the Background by the EventReceiver. The user would probably fill out the form and get an error trying to save, saying the Document was last saved by himself at xx:xx.

How can I update the Document's Fields BEFORE that "required field" popup happens?

2
  • Is there a reason why you wouldn't just use column defaults instead of an event receiver for this? Sep 7, 2022 at 15:19
  • Yes. I need to dynamically set a Type of Document and a specific entry in a List (that List generates a Folder in said Document Library) based off the path in the Library. The Document will also get some hidden colums set with keys for actions outside of sharepoint. All this lead me to using an EventReceiver. I've worked around this to aid development making the fields not required, but now I have to find a way to make the "Edit properties" form pops up once a user has uploaded a document that can't be classified.
    – Saik
    Sep 8, 2022 at 7:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.