Submit form to Sharepoint for library and close form

T

Tammy

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 = "(e-mail address removed)";
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
 
S

SSA

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();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top