.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Question about Workflow in Document Library with version control and check-in/out enabled

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :SharePoint


I use Sharepoint Foundation 2010 and have a workflow to set some metadata in a document with version control and check-in/check-out enabled (approval content is not enabled because anyone in the team can be a possible editor of the document).

My metadata is:

- a generated doc id with text+id (example P&D_1)

- a calculated status based in version: minor version = "on development" and major-version="published/approved"

I defined two workflows:

1) is called when item is created to define id and status.

2) is called when item is updated and status is re-calculated if version is major. (It is called in every item change, not only when user wants to publish a major version, because this option doesn't appear in SPD)

I noticed that sharepoint workflow must do a check-out to be able to update metadata, and because of this the version number is incremented. When version is minor, I don't care, but when version is major I have a problem, because just after publishing the version 1.0, the workflow changes metadata and the version to 1.1. and 1.1 means that the document is not approved anymore...


a) Isn't it possible to do the workflow to check-in and override the last/current version to not generate a new version??

b) Or is it possible to stop versi

View Complete Post

More Related Resource Links

2010 SharePoint global setting for document Library version control?


Apparently new Document Libraries created in Sharepoint are no longer set up the way we would like as far as version control.  Is there any way to set up SP so that any new document library created has specific settings, through Central admin control?

Jack Galante Sr Systems Engineer

i do see that previous versions this was not possible, but was curious if they changed this in 2010?

Check-out issue when opening a document from a document library when a read-only copy is open

We have an issue when a user has a read-only copy of a document from SharePoint open and then tries to check-out and edit another copy of the document (i.e. from the document library) the checked out copy is not connected to the web server. For the user it will look the same they will make edits, save and then close, but when they do so the document is not updated in SharePoint - it may be saved locally in their SP drafts, but the user will think that they have lost their version. We then get the checked out to another user error and you have to discard changes to get the document working again. Steps to reproduce this issue: * click on the name of a office doc on a Document Library * Make sure "Read Only" is selected and click "ok" * Minimize open document * click on the same file on the Document Library * Make sure "check out and edit" is selected and the "Use my local drafts folder" checkbox is ticked. Select OK. * Edit document and press save. Changes are never saved back in SharePoint, they are only on the local draft. We are using MOSS with SP2. Clients are on Office 2003 and 2007 Is this normal behaviour? Is there anything that can be done to prevent this from happening?

Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,


Sharepoint Workflow To Shoot Email Only When Folder Is Created In Document Library

Hi, Can anyone help me with the below issue, I am facing this from so long and didn’t figure out solution yet for the same. :( I want to send an email through SharePoint designer workflow only when a folder is created in document library (not file uploaded/updated event). Please provide me solution about how I can achieve this through SharePoint designer as don’t have enough coding acquaintance.

SPD workflow status show "starting" when I create a document from the library !!. and hangs

I have a document library in MOSS 2007. Have created a WF and that starts "autmatically when new item created" In the document library I have created couple of column those are mandatory (required columns) and user has to fill those column while uploading a document as well creating a document from library. WF has ran and completed succefully  when I use "upload" option to load a document.  As you are aware, when we "upload" a document, we will have to fill all "required columns" and the click "check in" command button.  After I do all this, document get loaded and WD ran succesfully. However, the WF is not running when I create a document (.docx) from this library (using "new" button) !!.  I have filled all required field in the document information panel . After save & exit from WORD application, I can see WF status as "starting". But, it never started and completed.  So I did following and found WF worked !! a) After creating document (.docx) using "new" option I found WF status "starting"!. So,  I did "Check-out and Check-in" manually from document library. After doing this,  WF ran and status has been changed as "completed" b) In SPD, I change workflow start option from "Automatic" to "Manually start".&nb

Intercept Check-In Event of Document Library in SharePoint 2010

we need to intercept the default check-in Event of the Document Library. The detailed requirements is as follows.   1. Intercept the check-in Event of Document Library. 2. Instead of the default check-in  page (normally this is the layout's checkin.aspx page), show our custom application page. 3. In the custom application page, allow users to provide some inputs. Validate the input values against values stored in database. 4. Once validated successfully, allow user to check-in the documents. Else, do not allow user to check-in the document.   One more additional requirement is the above things should happen only for our custom content type. In order to achieve the same, we are planning for deploying our custom document content types and perform the above operations on check-in event of the documents.     Another approach of performing the same is , have our own custom ECB Menu. The detailed process is as below.   a. Customize the check in menu (ECB) b. Show the custom form and get the inputs from user and do the validations c. On the OK button click, if validation is success, then update the meta data and check in the document or deny the process. d. But in this approach, we need to check the libraries version settings and that default functionalities should be added automatically to the check in process.   At this point of time, we a

Workflow data missing from Document Library

Hi, We have this strange situation where the workflow status is missing from document library views. Here is the situation: I have a Document Library with 3 OOTB approval workflows configured to start manually. Process is that user uploads a doc, start the first workflow, once it gets completed starts the second, and so forth. Now if I check the All Documents view of this Document Library, I can see these three workflows have 3 columns and that shows the status of the workflow - say "In progress", "Completed" etc. Now our users who use this document library and workflow complains that they cannot see these status of the workflow after some days. If a workflow is completed and status shows completed there, but after some days that column is blank. I've checked the modified data for the documents and this issue according to the user happens to documents that was uploaded 2 weeks back too, which means this doesn't happen to old document only. This document library has Major and Minor versioning enabled. Why does this happen, does SharePoint remove data for completed workflows? I checked the document's workflow page and its empty; nothing under running workflows and nothing under completed workflows. In Doc Library settings - Workflow settings I could not find an option View Workflow reports. That page has the following details: Use this page to view or

Unable to filter the "E-mail To" field in email enabled document library

Hi, We have setup a few email enabled docuement libraries to store emails relating to project work. Is there a way to make the "E-mail To" field in the library be filtered? It is greyed out and doesnt give you the option. The "E-mail From" and "E-mail Subject" are able to have a filter applied to them but for some reason the "E-mail To" field wont let you filter the content. The probelm is that there are over 500 files in the library and the easiest way to find messages is to be able ot filter this column in the library if it is at all possible.

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

WSS 3.0 Cannot Check-in document to Document Library

Hi all, I am having quite an annoying issue. Server Environment Win2k3 Standard R2 WSS 3.0 SP1 All fully patched Client Environment WinXP SP3 Office Professional Plus 2007 IE 8 All fully patched Document Library Settings Version Histroy enabled (Major and Minor versions) "Require documents to be checked out before they can be edited" option is YES Local Drafts folders are being used when checking out. Description of Issue The following symptoms appear only on a few systems in out company. It is computer-based, meaning the issue occurs regardless of which user is logged in (even Domain Admins) In an existing document library, if the user opens a document, they get prompted if they want to open in Read Only or Check Out and Edit. They choose to Edit and use local drafts folder. They make changes and save the document. When closing the document, they get prompted to check in. They click Yes. They choose the version type (Minor or Major) and Version comments and click OK. This error occurs: There has been a network or file permission error. The network connection may be lost. (https://sharepoint.abcdefg.com.au/docume) <-- You can see this address is not complete, Not sure if this is useful info or not When creating a new document, the document opens and the user enters text and clicks the save button. Now, instead of pointing to the SharePoint document library, th

Document Library version restore not behaving as expected on the "Name" column (file name)


After a rollback to a previous version, the value of the column "Name" in a document library is not restored. All other columns are restored properly. It seems that the column "Name" (file name) is excluded from the process of versioning.

I didn't find information on this behaviour on the internet. Any suggestions ?


How to Check Asp.net Control Is Enabled or Not



I want to check whether a control is enabled or not.

Sharepoint Server 2007 Document Library permission question


Is there a way to set permissions on document library where HR can see all documents but employees can only see the documents that they uploaded?

I am trying to configure permission level but can't find anything that will solve the purpose.

HR is hoping to do online enrollment and remove paper format.

View previous version of a file in document library using Client Object Model




Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :




When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?

Mail Enabled Document Library Not receiving email?



We have SP2010 Foundation in our Env.

I am testing mail enabled Documents in SP2010, But I am not able to receive mail in Document Library.

I have configured and verified the setting in Exchange 2007 and SP2010. Everything looks fine.


Mail are hitting the SP2010 Server but not delivered to Mail Enabled folders in SP.


Kindly HELP.........

SharePoint Workflow : Failed to Start when a document is added to library from server-side object mo


When I add a document using my server-side object model code, I get an exception "The type or namespace name 'Office' does not exist in the namespace 'Microsoft'" in the server logs and in the library I can see the Workflow status as "Failed to Start".





Interestingly, when I add a document to the same library from sharepoint site portal, it works just fine, the workflow kicks off with the state : in-progress.

Also, I modified the task form for the Approval workflow template from SharePoint Designer using infopath.(Not sure if that be a problem as adding from portal works fine.)

What am I missing out here??

 Details of the exception:

09/29/2010 18:11:19.15  w3wp.exe (0x2508)                        0x2710 SharePoint Foundation          Workflow Infrastructure        98d8 Unexpected Microsoft.SharePoint.SPException: <Error><CompilerError Line="0" Column="20" Text="The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (a

sql 2008 installation question, windows installer version check?


sql 2008 installed, but didn't get pop up for windows installer 4.5, though intallation complete, but still wants to confirm the windows installer version, however, the windows 2008 seems not like w2k3 to show all windows components you installed, I only see .net 3.5sp1 on the appwiz.cpl

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend