Problem re-submitting a form in SharePoint - InfoPath Dev
in

InfoPath Dev

Problem re-submitting a form in SharePoint

Last post 11-20-2008 01:53 PM by santos@bj. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-18-2008 10:09 AM

    Problem re-submitting a form in SharePoint

    I have an InfoPath form with multiple views that I open inside a SharePoint library.  The default view has a Submit button, and when clicked, it runs the following code:

    ' Some code to set values
    Me.DataConnections(connectionName).Execute().
    Application.Quit(True)

    This works fine the first time.  I'm able to submit the form with a unique name in a SharePoint library, and this triggers a workflow in SharePoint.

    This form is again opened from SharePoint library list, but the next time, it's a different view with an Approve button.  The approve button has the same code as above, but when executed, I get the following error:

    InfoPath cannot submit the form.
    An error occurred while the form was being submitted.

    A value in the form may be used to specify the file name. If you know the value in the form that specifies the file name, revise it and try again. Otherwise, contact the author of the form template.

       at Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall d)
       at Microsoft.Office.InfoPath.Internal.FileSubmitConnectionHost.Execute()
       at TestForm.FormCode.ApproveButton_Clicked(Object sender, ClickedEventArgs e) in FormCode.vb:line 168
       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

    Line 168 is the code  Me.DataConnections(connectionName).Execute()
    My understanding is that when this line is executed, it doesn't know what form to reference.  Correct?

    My question how do I fix this? 

    I'm googling for solutions, but if someone already knows a solution, it will save me a great deal of time. 

    BTW, I don't want to use the Rules in the button properties.  I'm already using that approach, for what I want to do, it's not good approach. 

  • 11-18-2008 10:06 PM In reply to

    Re: Problem re-submitting a form in SharePoint

    Hello,

    My guess is that the field you are using for the form name is not unique that's why you are getting this error. You need to make sure that the name of the form will be unique when you set up your submit. I found a helpful link that might help you with this http://www.infopathdev.com/forums/p/5567/20910.aspx#20910

     

     

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 11-18-2008 10:58 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Problem re-submitting a form in SharePoint

    Hello,

    Look at your sharepoint submit connection and check whether you have checked the checkbox "Allow OverWrite if the file Exists?". You need to check this checkbox if you want to overwrite on the same file that you have previously submitted.

  • 11-19-2008 07:00 AM In reply to

    Re: Problem re-submitting a form in SharePoint

    It has a unique filename and I do have "Allow OverWrite if the file Exists?" selected.

    I think I'm getting close to fixing it.  When I figure it out, I will post it.  If you already know, post it as well, we can compare notes. 

  • 11-20-2008 01:53 PM In reply to

    Re: Problem re-submitting a form in SharePoint

    Finally got it.  This article helped me

    http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx

     

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