Determine Who Has a SharePoint File/Form Open - Within InfoPath - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Determine Who Has a SharePoint File/Form Open - Within InfoPath

Last post 05-23-2013 07:17 AM by Hilary Stoupa. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 07-26-2010 07:51 AM

    Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi there everybody,

    its a long time ago since i wrote here the last time and as always its a pleasure to be right back again.

    As you can read out of the 'Subject' of this Thread you should have a clue where's the Problem. If multiple User have Write Permission on a InfoPath SPList.Item, and two or more of them try to edit the Form by opening it with the Full InfoPath Client at the same time, all of them, except the first one, will get the Message:

    "This Form cannot be filled out because you do not have adequate permissions, another user has the form open, or the form is open in another program. Do you want to open a read-only copy of the form?"

    This is basically a good feature, but i miss the Information about 'WHO' has currently the Document opened.

    Mr. Olander has already solved this riddle by creating a workaround: 'try to edit' some Attribute of the Form on the Form Library Page - which will reveal the name of the 'locking' user. (see: http://www.infopathdev.com/forums/p/5922/22095.aspx)

    But, to tell the truth, i dont think i can explain our chief executive officer that this is the only way SharePoint in combination with Infopath is capable of doing it. So i am looking currently for a Solution which will display the (and let it be only the Domain Loginname) instead of the error Message above.

    So any hints?

    If there IS really no way, then i have to life with it, but thats exactly what i want to figure out - with all of you. :)

    btw. if this task will be marked as 'Very Very Important'  in our Company (and believe me it looks currently like that), and there is really no easier way, it should be possible to create a WebService which will be called by the Form every time someone tries to open it. The WebService will try to edit a Parameter of the InfoPath Form within the Form Library and catch the exception with the Username, and returns it to the InfoPath Form back where i could display the current 'editor' within the Form as Field or as a Message window after the Error above. And yes i know, this is a really 'the last way a Programmer should go'-Solution.

  • 07-28-2010 12:51 AM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi Holy One,

    You can just call SharePoint's CheckOut from your form to cehck the form out. Hilary Stoupa will be blogging this easy no-code technique in the next week or two. Qdabra's qRules v2.3 will also support CheckOut and CheckIn. So, you don't need to install a Web Service. You simply have a couple rules On Load for your form:

    1. Is the form checked out? If so, switch to view and show checked-out status.
    2. Is the form not checked-out? If so, check the form out and switch to edit view

    Note: CheckIn and CheckOut have one complication. If people open a form and close it useing the X button, the form has no way of knowing that it should "uncheck out". Qdabra's Web Service works around this since it supports DAV it knows when a form is opened and closed and can correspondingly lock/unlock the form. Unfortunately, SharePoint's check-in and check-out, don't have that ability.

    Patrick Halstead
    Project Manager at Qdabra
  • 07-29-2010 05:38 AM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi there,

    well , easier said as done.

    Is the form checked out? - So, how to determine this within a Form? I can imagine a couple of ways, the easiest should be to add a External Data Source - The SP List where the item is saved, and mark as Column 'checked out' and 'checked out by'. Both will hold all information to determine who and if the file is checked out so that you can switch the Views BUT...

     as you already said, i could check out my form to 'make use' of those columns with the negative part that i need Qdabra's Web Service.

    Its nothing against Qdabra, if i could spend the money i would do it, but currently it is out of question. Also the only thing Qdabra WebService would do is to save me the time to code my own WebService. If i would code it myself there would be also a NoCode Implementation possible for the InfoPath Part.

    But that beside. Even IF i had the Information who has currently open the Form. I will always get the Message from above BEFORE my single sentence Code. So how to replace the InfoPath Build Error Message or at least put my before it?

  • 07-29-2010 08:30 AM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi -- you can check out your form using the SharePoint Lists web service -- no code needed. You have to add a query data connection to the web service, (_vti_bin/Lists.asmx) and select the CheckOut message. Also add a data connection to the library where the XML is submitted -- for that connection, you can select the checkbox for getting info about only the current form. You need the title. Then, on open, get the info about the XML (title) and set the query field in the Check Out connection to the full URL to the form (concat the URL of the library with the title). Set checkoutToLocal as false if this is a browser form -- you may be able to use true if client. Run the query on the Check Out data source. Ta-da -- checked out form.

    Since you'll first get info about the current XML, you can check prior to checking out if the form is already checked out -- and add appropriate logic. Switch to a "Cannot currently update, as form is checked out by: " and fill in the name of the person who has it checked out.

    I understand that this does not solve your issue -- you want to either supercede the message provided by IP or overwrite it, but I did want to address the confusion about the Check Out service being provided by Qdabra products -- this is a freely available web service in SharePoint, that you can connect to in InfoPath using a standard secondary data connection. Check In is also available, and just as easy to use.

    As to your issue -- I do not know of a way to circumvent or overwrite the opening message.

    Hilary Stoupa

  • 11-08-2010 01:01 PM In reply to

    • Thumbs
    • Not Ranked
    • Joined on 11-08-2010
    • Posts 4

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi Hilary,

    I saw your comments about using the list web service for checking out an item through Infopath. I have a question regarding checking in web browser infopath forms. I'm looking for a solution to auto check in my newly created form.

    I have the following requirements. To have unique form names, the name of the file is created using a field in the form (dropdown list) and the now() function.

    e.g. Expense Form 2010-11-08T21_40_22

    I'm using a  custom submit button to publish the form in the library (Web based form) When I click the new button in the form libarry, I select part of my form name fill in the rest of the form fields and submit the form. Result is that my newly created form is published but checked out. Would it be possible to use the list web service for check ins (Since my filename is only created just after the initial submit)?

    Love to hear your thoughts on this!

    Thanks in advance,

    Thumbs up! 

     

     

  • 11-08-2010 02:59 PM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi -- I also replied to your email on this, so check your email as that reply has some screenshots.

    Basically, you need to create a web service data connection to the CheckInFile op for the Lists Web Service.

    Then, in your form, set the pageUrl to the full URL to the form you have open (you can get the form name from a data connection to the library that the form submits to, and select the checkbox for getting info about just the open item. From there it is a simple concat formula to get the full URL). Set the CheckinType to 0, 1, or 2 -- this MSDN link has the info on that.

    Then run the query for the webservice, and there you are, all checked in....

    As I mentioned in email, however, I'd probably be more interested in figuring out why my new form is checked out than working around it....

    Hilary Stoupa

  • 11-12-2010 02:03 AM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi,

    Refer to "Since you'll first get info about the current XML, you can check prior to checking out if the form is already checked out", do you mean to check if "Checked Out To" is empty?  This does not work for forms that are open (somehow locked) but not explicitly checked out by users, though.  Do you know of any means to determine which user has the current file locked?

    Thanks.

    Janice
  • 11-15-2010 12:47 PM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    No, I'm afraid I don't. You may want to use SharePoint web services to check your document out on open so that you'll have that info. I blogged this last week, in case it can help you.
    Hilary Stoupa

  • 05-22-2013 06:48 PM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

    Hi Hilary

    Can you please explain your methods in steps and with a XSN file as example, i need to get it working on few applications which is deployed on server. thank you...

  • 05-23-2013 07:17 AM In reply to

    Re: Determine Who Has a SharePoint File/Form Open - Within InfoPath

     Did you check the blog post linked in my post above?

    Hilary Stoupa

Page 1 of 1 (10 items)
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.