OnSaveRequest Event Handler

R

Renjith

Hi,

I have to perform few tasks when a Infopath form is saved to local system
from a document library. For this I have written the below function but it
doesnot get invoked and Iam not able to view the alert message given. What
could be the reason?

function XDocument::OnSaveRequest(eventObj) {
// Write the code to be run before saving here.
XDocument.Application.Alert("on save");

eventObj.IsCancelled = eventObj.PerformSaveOperation();
// Write the code to be run after saving here.
eventObj.ReturnStatus = true;
}


Thanks
Renjith
 
B

Brisk

If i remember correctly, the form must be fully trusted for this event
handler to fire.
 
B

Brian Teutsch [MSFT]

Use Tools->Form Options to add the handler for your code. The code will not
be fired if there is not an entry in the XSF telling InfoPath to fire the
code (true for all handlers), so simply adding it in code will not work.

Brian
 
R

Renjith

That worked ! Thanks


Brian Teutsch said:
Use Tools->Form Options to add the handler for your code. The code will not
be fired if there is not an entry in the XSF telling InfoPath to fire the
code (true for all handlers), so simply adding it in code will not work.

Brian
 

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