0

My situation is this; I have a document library that contains reports (InfoPath 2010 forms). When an item is submitted it should clearly be marked as un-approved until it has passed an approval workflow (Custom 2010 SPD workflow). Once approved it should appear as a major version. Anyone can edit this major version but whenever an edit is made it should be saved as a copy and the original major version should remain for all to see. Once this copy has been approved it should replace the original approved document. Version history should be kept (so old major versions can be restored).

I've accomplished this by causing the submit button to append "-UNAPPROVED" onto the file name whenever it is saved, this works well. However, taking the -UNAPPROVED tag off when the workflow is completed (and approved) and then saving over the top of the last major is causing problems. Just changing the "name (for use in forms)" variable in the workflow throughs an error, telling the workflow to delete the previous version before the rename fixes this, but I needed to add a delay between the deletion and renaming or I get another error. This means although I've come up with a solution that performs the task, there is a ~5 min delay (waiting for the timer service) before the file is renamed and no version history is kept.

My question is this: Have I gone about this the wrong way? Or is there a way within my SPD workflow to save my document named Document01-"UNAPPROVED" over the top of Document01 and keep the version history (preferably without a 5 minute delay).

1 Answer 1

3

I don't see why you can't use the OOB versioning functionality. If you enable versioning and content approval for your library and turn on major and minor versions, then whenever a document is submitted, it is marked as Draft and it gets assigned a minor version. You can then use a standard approval workflow (or customize it to suit your needs) to approve the publishing of a major version.

In this way, you would not need to manually create a retention mechanism of the previous versions, thus avoiding all the problems you encountered.

6
  • The problem is that when a major version gets edited it is changed to a minor version. It is required that the default document a user finds when looking is the most recent approved version, not the one currently under revision. However, users still need to be able to view the lastest minor version if they choose. If it is possible to set up the list to view in this manor than that would be ideal. Commented Jan 16, 2014 at 0:36
  • So, you're saying that any user should be able to view minor versions even if they'll eventually get rejected?
    – MdMazzotti
    Commented Jan 16, 2014 at 0:44
  • Correct, the most obvious item should be the lastest major published verison for all users, but all user should also be able to view the lastest minor version if they need to. Commented Jan 16, 2014 at 0:48
  • Ok, a bit uncommon as a requirement. Anyhow, what about having two separate lists, one for major versions and one for drafts? You can easily create a DVWP in SharePoint designer where you can show draft versions for a given major document (you can relate drafts to majors by major ID)
    – MdMazzotti
    Commented Jan 16, 2014 at 8:05
  • Spreading the items into different lists was one of the thing I've tried in earlier development, but it quickly became messy when dealing with a single form template on multiple lists and was abandoned. Thinking about it again I think I might have a way to do it better and will give that another go. If that doesn’t work out I’ll try the DVWP route. Thanks for the help! (I'll close this question as marked as I feel there is probably no simpler solution) Commented Jan 16, 2014 at 8:17

Your Answer

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

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