Fake Error Message with Browser-Based Form

D

Deniz Yalman

Hello,

I've got a browser based infopath form which submits to my custom web
service. It works fine except an odd behaviour.

Whenever a user submit form over browser, -if this is first attempt-
infopath returns error message: "infopath cannot submit form". But actually
form submits data truly with a fake error message. And then user can submit
data without any error message.

How can i remove fake error message?

infopath 2007
sharepoint server 2007

Thanks in advance.
 
S

SSA

You can do a couple things:

1. Go to "Submit Options".
2. Enable "Use Custom Messages" and define your own user friendly message in
case submit fails. I am sure the message appears because something, probably
a rule, fails at the time of submitting.

You can also submit form programmatically. In that case, you will have the
option to suppress the "fake" error message that you get:

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{

try
{
FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["Main
submit"];

fc.Execute();

e.CancelableArgs.Cancel = false;

}

catch (Exception ex)
{

e.CancelableArgs.Cancel = true;
}
}

Event handler for this event is:
EventManager.FormEvents.Submit += new SubmitEventHandler(FormEvents_Submit);

This will suppress any fake errors!

Good luck
 

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