How can I submit my form by managed code (C#)? - InfoPath Dev
in

InfoPath Dev

How can I submit my form by managed code (C#)?

Last post 08-05-2008 10:07 PM by deepaksamvictor. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-14-2007 09:38 PM

    How can I submit my form by managed code (C#)?

    Hi all,

    I use this code for customize submit browser form and try to close form then back to document library.

    ...............

    FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["Main submit"];

    fc.Execute();

    this.Application.Quit();

    .................

    but Error is occured.

    An entry has been added to the Windows event log of the server.
    Log ID:5337
     
    When I see Event Log in server, I cannot see error in list.
     
    .....
     
    Additional, when I back to document library, my submitted form is saved. What's happen with my code.
     
    Please help me.
     
    Cheers.
    インフォパス ● デべロッパー
  • 11-01-2007 09:51 AM In reply to

    Re: How can I submit my form by managed code (C#)?

    Is this the default submit behavior? Maybe you need to use the Submit() method off the XDocument object:

    thisXDocument.Submit();

  • 01-08-2008 08:41 AM In reply to

    Re: How can I submit my form by managed code (C#)?

    Hi Mr. Collins.

    i wanna ask if there is an API for MS Forms Server that i can use?

    i'm embedding an infopath form in ASPX page, it is going alright, but i got a problem that when the form is saved it prompts the user to specify a name for the infopath file! after a user saves a file, how would i know the file name so that i render it again for him???

    plz, i need ur help!

    Thanks,

    Osama Momani.

  • 01-08-2008 01:11 PM In reply to

    Re: How can I submit my form by managed code (C#)?

    I don't have an answer to this. Is there someone else who can answer this question?

  • 01-08-2008 11:55 PM In reply to

    Re: How can I submit my form by managed code (C#)?

    Thank you for ur fast reply,

    actually, i found a way doing that! you can invoke the function Dialog_save('StrFileName') this function will save the form in sharepoint by the name StrFileName!!

    Dialog_save is an already present function! it is included in Core.js file that comes with Sharepoint.

    so, first you should add a reference to this file and other files before writing code! here is the complete picture:-

    <script type="text/javascript" src="/_layouts/FormResource.aspx?culture=1033&amp;version=1"></script>

    <script type="text/javascript" src="/_layouts/inc/Core.js?rev=0AlweRh6OY%2BdGdflbeh6dA%3D%3D"></script>

    <script type="text/javascript" src="/_layouts/inc/IntlCoreStrings.js?rev=Oi%2BjzqGIiSFExZmi%2FF9VhQ%3D%3D"></script>

    <script type="text/javascript" src="http://sv-testforms/_layouts/FormResource.aspx?solutionId=I:d0699504-1179-4349-9a3e-e14e275bbdc2:1a225b7a-4de9-422d-b3a1-216cc837033e:633348769540000000&amp;view=0&amp;browser=IE&amp;viewFile=View%2Ejs&amp;version=1"></script>

    <script type="text/javascript"><!--

    UserAgentInfo.strBrowser = 1;

    //--></script>

     Then you invoke Dialog_Save function as follows!!

    <button id="Button2" onclick="Dialog_Save('NAME');" style="width: 205px; height: 24px" >

    Save</button>

    hope it would be helpful!!

    Thanks,

    Osama Momani.

  • 01-09-2008 01:48 PM In reply to

    Re: How can I submit my form by managed code (C#)?

    Awesome tip! Thanks for sharing this.

    Have you verified that every one of those <script/> blocks are actually needed to accomplish this? It looks like all you might need is the one for Core.js. I'd rather not include any additional blocks than are required.

  • 08-05-2008 10:07 PM In reply to

    Re: How can I submit my form by managed code (C#)?

    Hi Greg,

    Dim searcher As DirectorySearcher = New DirectorySearcher("(mailNickname=" + userName + ")")

    Dim result As SearchResult = searcher.FindOne()

    Dim employee As DirectoryEntry = result.GetDirectoryEntry()

    Dim Empno As String = employee.Properties("employeenumber").Value.ToString()

    I am using this code to retrieve data from Active Directory

    Me too facing the same error Log ID : 5337.

     

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