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 / October 2006

Tip: Looking for answers? Try searching our database.

submit handler action BEFORE submit?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jörn Willhöft - 04 Oct 2006 20:20 GMT
Hi there,

for my completely database based form I need to do scripting just BEFORE the
form is submitted. I tried the following:

- register for the onClick() event of a submit button
--> calls the registered function AFTER the submit action
- register for the onSubmitRequest() event
--> forces me to implement the whole submit action myself. Explicitly
calling XDocument.Submit() out of this function is not allowed.

All I want is to add some additional action before the usual database
update. How can I do that?

Thanks in advance,
 Jörn
S.Y.M. Wong-A-Ton - 05 Oct 2006 07:13 GMT
I think you've pretty much answered your own question by coming up with the
second solution. :)

You need to write code in the OnSubmitRequest() event handler. At the end of
the event handler, use

eventObj.ReturnStatus = true;

to indicate success. Before this line of code you can write code to submit
changes to the database with

XDocument.DataAdapters["Main connection"].Submit();

where "Main connection" is the name of the data connection to the database.
You must/cannot use XDocument.Submit() to submit the form; but you already
discovered this. And before this line you can write your code that must run
before the submit takes place.
---
S.Y.M. Wong-A-Ton

> Hi there,
>
[quoted text clipped - 12 lines]
> Thanks in advance,
>   Jörn
Jörn Willhöft - 05 Oct 2006 09:15 GMT
Thank you!

> XDocument.DataAdapters["Main connection"].Submit();

That did the trick.
Unfortunately I cannot find the Submit() function in the online
documentation anywhere, even now that I know it's there.

Again, thank you very much,
 Jörn

> I think you've pretty much answered your own question by coming up with
> the second solution. :)
[quoted text clipped - 32 lines]
>> Thanks in advance,
>>   Jörn
S.Y.M. Wong-A-Ton - 06 Oct 2006 05:30 GMT
You're welcome!
---
S.Y.M. Wong-A-Ton

> Thank you!
>
[quoted text clipped - 43 lines]
> >> Thanks in advance,
> >>   Jörn
 
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.