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 2007

Tip: Looking for answers? Try searching our database.

Submit form to Sharepoint for library and close form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tammy - 14 Sep 2007 16:00 GMT
Hi All,

I am using custom code to embed and email a form...

function button::OnClick(eventObj)

{
createEmail();
}

function createEmail()

{
  var xmlContact =
XDocument.DOM.selectSingleNode("/my:myFields/my:addContact");
  var xmlPri = XDocument.DOM.selectSingleNode("/my:myFields/my:pri");

  {
     var oEnvelope = Application.ActiveWindow.MailEnvelope;
       
     oEnvelope.Subject =
XDocument.DOM.selectSingleNode("/my:myFields/my:pri").text;
     oEnvelope.To = "someone@someplace.com";
     oEnvelope.CC =
XDocument.DOM.selectSingleNode("/my:myFields/my:addContact").text;
     oEnvelope.Visible = true;
}
}

However when I try to submit to sharepoint through data connection or use
the Close form action it breaks my code above. Can anyone provide additional
code that will also submit to a form library and close the form following the
email submit?

thanks in advance
SSA - 15 Sep 2007 10:08 GMT
Create a data connection that will submit your form. Select "close form after
submit" (I dont remember the exact words). After creating the envelope,
submit the form programmatically using the following code:

  public void InternalStartup()
       {
     
           EventManager.FormEvents.Submit += new
SubmitEventHandler(FormEvents_Submit);
     }

  public void FormEvents_Submit(object sender, SubmitEventArgs e)
       {
FileSubmitConnection SubmitConnection =
(FileSubmitConnection)this.DataConnections["SubmitForm"];
string location = e.InputParameters["SaveLocation"].ToString();
           SubmitConnection.FolderUrl = location.Substring(0,
location.LastIndexOf("/"));
           SubmitConnection.Execute();
}

   

> Hi All,
>
[quoted text clipped - 31 lines]
>
> thanks in advance
 
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.