User accessing form - InfoPath Dev
in

InfoPath Dev

User accessing form

Last post 02-16-2010 05:53 AM by zubair. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-19-2009 03:45 AM

    • zubair
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Karachi, Pakistan
    • Posts 5

    User accessing form

    Hi All,  

    I need your help! As you all know, if one user (say User A) opens a form another user (say User B) who tries to access the same form recieves the following message:

    "The form cannot be filled out because you do not have adequate permission, 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?"

    Now my question is:

    1. Can I retrieve the name of the user  (AD name) who opened the form first (User A)?

    2. Can I make this form editable to User B as well (while another user has the form open)?

    Waiting for reply. Thanks in advance

    Muhammad Zubair Uddin
    Filed under:
  • 02-04-2010 04:54 PM In reply to

    • zxkuqyb
    • Not Ranked
      Male
    • Joined on 01-14-2009
    • Indianapolis, IN
    • Posts 18

    I'm needing the same answer...does anyone have any insights for Zubair's question?

     Thanks,

     Tom Barrett

    Thomas N. Barrett
  • 02-16-2010 05:53 AM In reply to

    • zubair
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Karachi, Pakistan
    • Posts 5

    Here is my solution step by step: 

    1. Create a read only view in your form template
    2. Create a field say 'UserName' to store the name of the user (or UserID if u like)
    3. At the time of loading (in form loading event) check if the form is not openned by any other user using 'this.ReadOnly == false'          
    4. If form is not already open i.e 'this.ReadOnly == false' :
      • Store the name of logged-in user in the 'UserName' field in the form loading event
      • Switch to normal view using " e.SetDefaultView("NormalViewName") ", where NormalViewName is the name of you "Normal" View, in form loading event
      • In the "OnSwitchView" event use 'this.Save()' to save the form.
    5. If form is already opened by another user:
      • Display the message and name of the user working on the form using the 'UserName' field
      • Open the read only view of the form by switching to read only view using " e.SetDefaultView("ReadOnlyViewName") " (where ReadOnlyViewName is the name of you "Read Only" View)

    I hope this will help. I will wait for your comments and suggestions  

    Note: we are not using 'date updated' field of the form library for tracking changes as it will be updated everytime 'this.Save()' statement is executed. Instead changes are tracked from audit log maintained seperately.

    Muhammad Zubair Uddin
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.