0
votes

I am storing Infopath forms in a Sharepoint Document Library.

Because these forms are completed in a disconnected environment, the document library is used for storing the submitted forms (and other related documents). A web application also updates the Infopath documents.

The Infopath Template associated with the forms is installed on user's PCs as an msi.

I've noticed that if a user has one of the forms open from the document library (but not checked out),using the Copy web service to update the document returns a "DestinationCheckedOut" error. My question is, is there anything I can use to query Sharepoint to determine if a user has the file opened. I've used Lists web service and CheckoutUser but this only worked if document is checked out (not just open). I've also tried setting "Version Settings" to "Require documents to be checked out when edited" but doing so returns the error "Infopath cannot open the following file:.....The file is not a valid XML File" when the form by opened by a user.

I am going to handle the "DestinationCheckedOut" exception but wanted to have my code check for this scenario first before the update process is attempted.

Any help would be appreciated.

1

1 Answers

0
votes

I don't know if there is any Web service that return the information you are looking for.

The server side object model calls are SPFile.CheckOutStatus and SPFile.CheckOutType ( http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile_properties.aspx ). There are 2 types of "checked out" one when document is simply opened for editing and the other when it is explicitly checked out - you hitting the first one.