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 / September 2005

Tip: Looking for answers? Try searching our database.

Delete using code - Find works & Delete does not

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Nemegeer - 13 Sep 2005 19:55 GMT
Hi,

I'm puzzled by a problem and I don't find a solution or a clue to solve it
...

I have set up a sharepoint services, created an Infopath form that submits
to a forms library. Now, I want to delete a document in code.

I'm using httpWebRequest to implement it. It works fine for a FIND, a DELETE
does only work on my development environment (virtual pc, W2003, Infopath,
etc.)

Any clues for where to start looking ??

Thanks,
Marc
JR - 16 Sep 2005 17:51 GMT
Are you using managed or unmanaged code?  From my understanding (and I could be wrong about this part, so please feel free to correct me) if you are using managed code, your form will need to be digitally signed so it can be fully trusted.  Without full trust, you may not be able to delete the file.

We are currently using unmanaged code to delete a form from the library and it works fine with the form security set to "Automatically determine security level..." which is translating into Domain level security when we publish the form.

Here's the snippet of jscript code, in case it helps..

==============================
// create an xmlhttp object.
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");

// does the file already exist - returns 200/201 if found, 404 if not
oXmlHttp.Open("HEAD", libraryUrl, false);
oXmlHttp.Send();

// document already exists, delete it
if (oXmlHttp.Status == 200 || oXmlHttp.Status == 201)
{
      oXmlHttp.Open("DELETE", libraryUrl, false);
      oXmlHttp.Send();
}
==============================

Of course, you will probably want to wrap this in a try, catch..

> Hi,
>
[quoted text clipped - 12 lines]
> Thanks,
> Marc
 
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.