Error when submit edited Form via Code. - InfoPath Dev
in

InfoPath Dev

Error when submit edited Form via Code.

Last post 10-30-2009 04:06 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-26-2009 04:07 AM

    Error when submit edited Form via Code.

    Hello Everybody.

    Normally i only read newsgroup-threads for solving my problems but in this case i did't find anything similar to my problem.
    I have an Infopath-Form which submits itself via custom code to a document-library on a MOSS.
    In the library i click on new and fill out the form and submit it - everything works great.
    BUT- when i reopen the form for editing and try to submit it again i get a script error: (I try to translate it to english..)

    "The Form cannot be send to the location: http://{myLibrary}. The file "{Filename}" is checked out by {domain\ME!} or it is locked for editing."

    I checked on the server and the file is not checked out even because checking out is not activated on this library.

    I submit the form via custom code like this:

     function XDocument::OnSubmitRequest(eventObj) {
        SubmitForm();
        eventObj.ReturnStatus = true;
        if (XDocument.Util.Match(XDocument.Solution.URI, "http://.*")) {
             Application.Quit(true);
        }
     }

    function SubmitForm(){
       if (XDocument.Util.Match(XDocument.Solution.URI, "http://.*")) {
           var Title = "Besuchsbericht";
           if (getNodeValue("Besuchsthema") == "Telefontermin") Title= "Telefonbericht";
           var FileName= Title + " bei '" + getNodeValue("Firma1") + "' (" + getNodeValue("Kundennummer") + ").xml";
           XDocument.DataAdapters["Versenden (Primär)"].FileName=FileName;
           XDocument.DataAdapters["Versenden (Primär)"].Submit();             //
    <-------------------------------------------------------------- This is where the exception occurs
       }
    }

    Has anybody got an idea whats going on there?

    Thanks , Axel

  • 10-30-2009 04:06 PM In reply to

    Re: Error when submit edited Form via Code.

    Hi -- it seems to me that the file name you are submitting would be the same as the name of the file you have open. In your submit connection, did you set the form to overwrite if there was an existing version with the same name?

    Hilary Stoupa

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