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