Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2005

Tip: Looking for answers? Try searching our database.

Read Only lock on InfoPath form in Sharepoint.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidR - 25 Feb 2005 04:31 GMT
Hi,

I have a document library in Sharepoint that stores InfoPath forms of a
specific template.

I've used Visual Studio tools and C# to develop the InfoPath template. It
contains an HTML button in a custom task pane that calls through to the C#
code and, among other things, closes the form by using:-
thisApplication.XDocuments.Close(0);

When I test this on a form in the library it works correctly, but when I go
to reopen the form, I get an message :-
"This form cannot be filled out, either 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 version of this form?"

The same message appears if I use the command:- thisApplication.Quit();

The message does not appear if I close the form manually (eg click cross
button).

I've seen a few other posts where people are getting this message, but not
in relation to the use of the code I have mentioned.

I was wondering if anyone knew why this happens in response to the commands
I have mentioned, and whether there is a fix or workaround.

Any help in this regard would be appreciated.

Thanks,
David.
Chris - 01 Mar 2005 06:45 GMT
Hi David,

I have the same problem, when opening the Infopath-Doc.
"This form cannot ..."
I open the document from a webserver (I send a xml-response with the
infopath-data)
Have you found a solution to avoid this message ?

Cheers,
Chris

> Hi,
>
[quoted text clipped - 27 lines]
> Thanks,
> David.
DavidR - 01 Mar 2005 07:39 GMT
Hi Chris,

Yes I did find a solution to this one.

The custom task pane HTML Button was running a line of script like :-
window.external.Window.Extension.C#Method
to call a method in the Form Code for the InfoPath Doc.

The method, ran through its code and finally called
thisApplication.Quit(true), or one of the other close commands.

In the end I moved the line of code that quits infopath out of the C# Method
and into the script on the custom task pane. My script code ended up looking
like :-
window.external.Window.XDocument.Extension.C#Method;
window.external.Window.Close(true);

Running the Close method stops the error on reopen from occurring.

I'm not certain why this fixes it, but my guess is that the call to the
method on the InfoPath form puts a lock on it, and because the context is
never returned back to the script, the lock remains, and when you go to
reopen it, you get the message.

So, perhaps you have another process accessing code in your form, but the
code stops somehow (eg Quit, error, etc) before it can return to the context
of the caller.
Hope this helps a bit.

Cheers,
David.

> Hi David,
>
[quoted text clipped - 41 lines]
> > Thanks,
> > David.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.