OnSubmitRequest Event Handler

F

foomonkey

I want to be able to close InfoPath after the form has been submitted.
It seems I need to implement an event handler for the OnSubmitRequest
event. I found this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdevtOnLoad.asp

This form is being submitted to a SharePoint site but I just want to
add a little script to close the form when it is done. The article
above and others seem to imply that if I override OnSubmitRequest, I am
responsible for all Submit logic. Is there a way to take advantage of
the built-in submit logic to Sharepoint and just add my code on the
end? Something like:

function XDocument::OnSubmitRequest(eventObj)
{
// do the built in save stuff here...

// then my code.
Application.ActiveWindow.Close(true);
}

Thanks.
Andrew
 
M

MatsonPP

XDocument.Submit() will handle all the normal submission automatically.
Then you can follow with your window closing.

Ciao,
Matt
 
F

foomonkey

Sounds easy. However, I get this error:

The following error occurred:

InfoPath cannot submit the form.
Invalid context for OM call.
XDocument.Submit cannot be called from the XDocument::OnSubmitRequest
handler.

File:script.js
Line:52

Why does this have to be so difficult?
 

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