Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

To start with here is my scenario. I have a document library which all users have read-only access to. There are a few trusted people who can upload items to it. A small percentage of the items uploaded should only be able to be seen by a certain group.

To achieve this I have created a workflow that checks the value of a sensitivity field that the uploader will set. If it is of a "sensitive" value, the workflow breaks the permissions of the item and sets it so that only the single group can view the item.

In terms of functionality, I have achieved what I wanted. I am however having the same problems I have had with event receivers in the past (and never really got to the bottom of).

When uploading a document in SharePoint, it seems to happen in two parts. You select the file and click upload. At this point the document is uploaded and THEN the edit properties dialog is displayed.

The "new" event seems to be triggered after the upload button is clicked but BEFORE the save button is pressed on the edit properties dialog shown after.

My workflow is set to fire both when a new document is created, and when a document is changed.

The problem is that on the "new" event, the sensitivity value has not yet been populated so the permissions will not be changed appropriately. And the "change" event is not fired when the properties are entered and saved on the initial upload (they are for future changes).

Will workflows never fire on the initial save of properties after uploading a document? And if this is the case, how do people get around wanting to process something on a new item?

Thanks for your time

Zak

share|improve this question
    
Do you have any required fields? I know if you have required fields and click "cancel" on the properties form the file remains checked out. I don't have time to test it myself but I'm curious if item added runs on upload or on check in. You might also try turning on require items to be checked out and see if that makes any difference. –  ToddersLegrande Jan 10 '13 at 13:33
    
That does what I need. When I switch on "require documents to be checked out", the workflow starts on the initial load but stays with a status of "Starting".... only processing and completing once the user has entered the information and pressed save. Thanks for your suggestion. –  Zak Jan 11 '13 at 11:57
    
I've posted this as an answer. Please mark as answer / upvote if you feel it has helped out. –  ToddersLegrande Jan 11 '13 at 12:29

1 Answer 1

up vote 0 down vote accepted

The best recommendation I can come up with is use a combination of required fields and requiring check out to be enabled on the document library.

When you have this set up the workflow will not run until the document is finally checked in. The users will not be able to check in their documents until they fill out the required fields. This results in a scenario where required fields must be filled out prior to a workflow starting.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.